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

Unified Diff: src/gpu/SkGrPriv.h

Issue 1348583002: Make skpaint->grpaint flow work for composing draws (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove unused inheriteds to satisfy clang Created 5 years, 3 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 | « src/gpu/SkGr.cpp ('k') | src/gpu/batches/GrDrawAtlasBatch.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGrPriv.h
diff --git a/src/gpu/SkGrPriv.h b/src/gpu/SkGrPriv.h
index 5cf4dd24d63acb98b684560dc39ce5f85c59fcab..56a086e93527470768bc1745426968e069ce4f42 100644
--- a/src/gpu/SkGrPriv.h
+++ b/src/gpu/SkGrPriv.h
@@ -9,10 +9,17 @@
#define SkGrPriv_DEFINED
#include "GrTypes.h"
-#include "SkPoint.h"
+#include "SkImageInfo.h"
+#include "SkXfermode.h"
class GrCaps;
+class GrContext;
+class GrFragmentProcessor;
+class GrPaint;
class GrUniqueKey;
+class SkPaint;
+class SkMatrix;
+struct SkIRect;
/**
* Our key includes the offset, width, and height so that bitmaps created by extractSubset()
@@ -28,4 +35,35 @@ class GrUniqueKey;
void GrMakeKeyFromImageID(GrUniqueKey* key, uint32_t imageID, const SkIRect& imageBounds,
const GrCaps&, SkImageUsageType);
+/** Converts an SkPaint to a GrPaint for a given GrContext. The matrix is required in order
+ to convert the SkShader (if any) on the SkPaint. */
+bool SkPaintToGrPaint(GrContext*,
+ const SkPaint& skPaint,
+ const SkMatrix& viewM,
+ GrPaint* grPaint);
+
+/** Ignores the SkShader (if any) on skPaint. */
+bool SkPaintToGrPaintNoShader(GrContext* context,
+ const SkPaint& skPaint,
+ GrPaint* grPaint);
+
+/** Replaces the SkShader (if any) on skPaint with the passed in GrFragmentProcessor. The processor
+ should expect an unpremul input color and produce a premultiplied output color. */
+bool SkPaintToGrPaintReplaceShader(GrContext*,
+ const SkPaint& skPaint,
+ const GrFragmentProcessor* shaderFP,
+ GrPaint* grPaint);
+
+/** Blends the SkPaint's shader (or color if no shader) with the color which specified via a
+ GrBatch's GrPrimitiveProcesssor. Currently there is a bool param to indicate whether the
+ primitive color is the dst or src color to the blend in order to work around differences between
+ drawVertices and drawAtlas.
+ */
+bool SkPaintToGrPaintWithXfermode(GrContext* context,
+ const SkPaint& skPaint,
+ const SkMatrix& viewM,
+ SkXfermode::Mode primColorMode,
+ bool primitiveIsSrc,
+ GrPaint* grPaint);
+
#endif
« no previous file with comments | « src/gpu/SkGr.cpp ('k') | src/gpu/batches/GrDrawAtlasBatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698