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

Unified Diff: include/gpu/SkGr.h

Issue 283803003: Move skPaint2GrPaint to SkGr.h/cpp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add else clause to Sk2GrShader Created 6 years, 7 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 | « no previous file | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/SkGr.h
diff --git a/include/gpu/SkGr.h b/include/gpu/SkGr.h
index 1f3c5affe444e9208fbf17faa74d237a9214f799..041329933b2b1e6af903ee15a1165d17769533b1 100644
--- a/include/gpu/SkGr.h
+++ b/include/gpu/SkGr.h
@@ -76,6 +76,25 @@ GrTexture* GrLockAndRefCachedBitmapTexture(GrContext*, const SkBitmap&, const Gr
void GrUnlockAndUnrefCachedBitmapTexture(GrTexture*);
////////////////////////////////////////////////////////////////////////////////
+
+class SkGpuDevice;
+
+// Converts a SkPaint to a GrPaint, ignoring the SkPaint's shader.
+// justAlpha indicates that the SkPaint's alpha should be used rather than the color.
+// Callers may subsequently modify the GrPaint. Setting constantColor indicates
+// that the final paint will draw the same color at every pixel. This allows
+// an optimization where the the color filter can be applied to the SkPaint's
+// color once while converting to GrPaint and then ignored.
+void SkPaint2GrPaintNoShader(SkGpuDevice* dev, const SkPaint& skPaint, bool justAlpha,
+ bool constantColor, GrPaint* grPaint);
+
+// This function is similar to skPaint2GrPaintNoShader but also converts
+// skPaint's shader to a GrTexture/GrEffectStage if possible.
+// constantColor has the same meaning as in skPaint2GrPaintNoShader.
+void SkPaint2GrPaintShader(SkGpuDevice* dev, const SkPaint& skPaint,
+ bool constantColor, GrPaint* grPaint);
+
+////////////////////////////////////////////////////////////////////////////////
// Classes
class SkGlyphCache;
« no previous file with comments | « no previous file | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698