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 |