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

Unified Diff: Source/core/platform/graphics/skia/NativeImageSkia.cpp

Issue 23102018: Refactoring DrawLooper so that it can apply shadow effects as skia image filters (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Adding missing adoptRefs Created 7 years, 4 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/core/platform/graphics/GraphicsContextState.h ('k') | Source/core/rendering/EllipsisBox.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/graphics/skia/NativeImageSkia.cpp
diff --git a/Source/core/platform/graphics/skia/NativeImageSkia.cpp b/Source/core/platform/graphics/skia/NativeImageSkia.cpp
index dc81cd51250e37ec5b8ba5b44688e66325db6b8e..44d85a9f7c4cb0797fe8fc2c3bff37449673b074 100644
--- a/Source/core/platform/graphics/skia/NativeImageSkia.cpp
+++ b/Source/core/platform/graphics/skia/NativeImageSkia.cpp
@@ -31,6 +31,7 @@
#include "config.h"
#include "core/platform/graphics/skia/NativeImageSkia.h"
+#include "core/platform/FloatConversion.h"
#include "core/platform/PlatformInstrumentation.h"
#include "core/platform/chromium/TraceEvent.h"
#include "core/platform/graphics/FloatPoint.h"
@@ -326,7 +327,14 @@ void NativeImageSkia::draw(GraphicsContext* context, const SkRect& srcRect, cons
SkPaint paint;
paint.setXfermodeMode(compOp);
paint.setAlpha(context->getNormalizedAlpha());
- paint.setLooper(context->drawLooper());
+ DrawLooper* drawLooper = context->drawLooper();
+ if (drawLooper) {
+ if (drawLooper->shouldUseImageFilterToDrawBitmap(bitmap())) {
+ paint.setImageFilter(context->drawLooper()->imageFilter());
+ } else {
+ paint.setLooper(drawLooper->skDrawLooper());
+ }
+ }
// only antialias if we're rotated or skewed
paint.setAntiAlias(hasNon90rotation(context));
« no previous file with comments | « Source/core/platform/graphics/GraphicsContextState.h ('k') | Source/core/rendering/EllipsisBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698