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

Unified Diff: src/gpu/GrLayerCache.h

Issue 792923002: Apply the layer's image filter to the hoisted image (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix cast Created 6 years 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 | « gyp/gpu.gypi ('k') | src/gpu/GrLayerHoister.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrLayerCache.h
diff --git a/src/gpu/GrLayerCache.h b/src/gpu/GrLayerCache.h
index b9b59d06bcf209a5d1a5fa788e501837c3da75f1..0ea23b3fc7294425c690da96c2707cf572c4c068 100644
--- a/src/gpu/GrLayerCache.h
+++ b/src/gpu/GrLayerCache.h
@@ -12,6 +12,7 @@
#include "GrRect.h"
#include "SkChecksum.h"
+#include "SkImageFilter.h"
#include "SkMessageBus.h"
#include "SkPicture.h"
#include "SkTDynamicHash.h"
@@ -151,16 +152,23 @@ public:
, fStop(stop)
, fBounds(bounds)
, fPaint(paint ? SkNEW_ARGS(SkPaint, (*paint)) : NULL)
+ , fFilter(NULL)
, fTexture(NULL)
, fRect(SkIRect::MakeEmpty())
, fPlot(NULL)
, fUses(0)
, fLocked(false) {
SkASSERT(SK_InvalidGenID != pictureID);
+
+ if (fPaint) {
+ fFilter = SkSafeRef(fPaint->getImageFilter());
+ fPaint->setImageFilter(NULL);
+ }
}
~GrCachedLayer() {
SkSafeUnref(fTexture);
+ SkSafeUnref(fFilter);
SkDELETE(fPaint);
}
@@ -179,6 +187,7 @@ public:
}
GrTexture* texture() { return fTexture; }
const SkPaint* paint() const { return fPaint; }
+ const SkImageFilter* filter() const { return fFilter; }
const SkIRect& rect() const { return fRect; }
void setPlot(GrPlot* plot) {
@@ -207,7 +216,11 @@ private:
// The paint used when dropping the layer down into the owning canvas.
// Can be NULL. This class makes a copy for itself.
- const SkPaint* fPaint;
+ SkPaint* fPaint;
+
+ // The imagefilter that needs to be applied to the layer prior to it being
+ // composited with the rest of the scene.
+ const SkImageFilter* fFilter;
// fTexture is a ref on the atlasing texture for atlased layers and a
// ref on a GrTexture for non-atlased textures.
« no previous file with comments | « gyp/gpu.gypi ('k') | src/gpu/GrLayerHoister.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698