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

Unified Diff: include/core/SkShader.h

Issue 1724503002: Add dest type hint to SkShader::ContextRec (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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 | « gm/SkLinearBitmapPipelineGM.cpp ('k') | src/core/SkBlitter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkShader.h
diff --git a/include/core/SkShader.h b/include/core/SkShader.h
index 8e69fafa78a34500a0b70f4d4f981391f152c0cc..72cd4a2dbeec7535bcf5e2b5db178fb553e9cc9a 100644
--- a/include/core/SkShader.h
+++ b/include/core/SkShader.h
@@ -10,6 +10,7 @@
#include "SkBitmap.h"
#include "SkFlattenable.h"
+#include "SkImageInfo.h"
#include "SkMask.h"
#include "SkMatrix.h"
#include "SkPaint.h"
@@ -96,14 +97,22 @@ public:
* ContextRec acts as a parameter bundle for creating Contexts.
*/
struct ContextRec {
- ContextRec(const SkPaint& paint, const SkMatrix& matrix, const SkMatrix* localM)
+ enum DstType {
+ kPMColor_DstType, // clients prefer shading into PMColor dest
+ kPM4f_DstType, // clients prefer shading into PM4f dest
+ };
+
+ ContextRec(const SkPaint& paint, const SkMatrix& matrix, const SkMatrix* localM,
+ DstType dstType)
: fPaint(&paint)
, fMatrix(&matrix)
- , fLocalMatrix(localM) {}
+ , fLocalMatrix(localM)
+ , fPreferredDstType(dstType) {}
- const SkPaint* fPaint; // the current paint associated with the draw
- const SkMatrix* fMatrix; // the current matrix in the canvas
- const SkMatrix* fLocalMatrix; // optional local matrix
+ const SkPaint* fPaint; // the current paint associated with the draw
+ const SkMatrix* fMatrix; // the current matrix in the canvas
+ const SkMatrix* fLocalMatrix; // optional local matrix
+ const DstType fPreferredDstType; // the "natural" client dest type
};
class Context : public ::SkNoncopyable {
« no previous file with comments | « gm/SkLinearBitmapPipelineGM.cpp ('k') | src/core/SkBlitter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698