Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1926)

Unified Diff: Source/platform/graphics/filters/SourceAlpha.cpp

Issue 1056353003: Derive the SourceAlpha filter input from SourceGraphic (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix variable name. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/graphics/filters/SourceAlpha.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/filters/SourceAlpha.cpp
diff --git a/Source/platform/graphics/filters/SourceAlpha.cpp b/Source/platform/graphics/filters/SourceAlpha.cpp
index d215cf2c80004ca00f587b0faffe3394058c4096..242081364481b50195d555196f615ce62e975b78 100644
--- a/Source/platform/graphics/filters/SourceAlpha.cpp
+++ b/Source/platform/graphics/filters/SourceAlpha.cpp
@@ -21,10 +21,8 @@
#include "config.h"
#include "platform/graphics/filters/SourceAlpha.h"
-#include "platform/graphics/Color.h"
#include "platform/graphics/filters/Filter.h"
#include "platform/graphics/filters/SkiaImageFilterBuilder.h"
-#include "platform/graphics/filters/SourceGraphic.h"
#include "platform/text/TextStream.h"
#include "third_party/skia/include/effects/SkColorFilterImageFilter.h"
#include "third_party/skia/include/effects/SkColorMatrixFilter.h"
@@ -32,9 +30,9 @@
namespace blink {
-PassRefPtrWillBeRawPtr<SourceAlpha> SourceAlpha::create(Filter* filter)
+PassRefPtrWillBeRawPtr<SourceAlpha> SourceAlpha::create(FilterEffect* sourceEffect)
{
- return adoptRefWillBeNoop(new SourceAlpha(filter));
+ return adoptRefWillBeNoop(new SourceAlpha(sourceEffect));
}
const AtomicString& SourceAlpha::effectName()
@@ -43,17 +41,21 @@ const AtomicString& SourceAlpha::effectName()
return s_effectName;
}
+SourceAlpha::SourceAlpha(FilterEffect* sourceEffect)
+ : FilterEffect(sourceEffect->filter())
+{
+ setOperatingColorSpace(sourceEffect->operatingColorSpace());
+ inputEffects().append(sourceEffect);
+}
+
FloatRect SourceAlpha::determineAbsolutePaintRect(const FloatRect& requestedRect)
{
- FloatRect srcRect = filter()->sourceImageRect();
- srcRect.intersect(requestedRect);
- addAbsolutePaintRect(srcRect);
- return srcRect;
+ return inputEffect(0)->determineAbsolutePaintRect(requestedRect);
}
PassRefPtr<SkImageFilter> SourceAlpha::createImageFilter(SkiaImageFilterBuilder* builder)
{
- RefPtr<SkImageFilter> sourceGraphic(builder->build(builder->sourceGraphic(), operatingColorSpace()));
+ RefPtr<SkImageFilter> sourceGraphic(builder->build(inputEffect(0), operatingColorSpace()));
SkScalar matrix[20] = {
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
« no previous file with comments | « Source/platform/graphics/filters/SourceAlpha.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698