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

Unified Diff: include/gpu/GrTextContext.h

Issue 135683006: Add fallback code for TextContexts that don't support all features (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 11 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
Index: include/gpu/GrTextContext.h
diff --git a/include/gpu/GrTextContext.h b/include/gpu/GrTextContext.h
index 273e0947b11d92b6c4daaf3ba912271b87196c7e..44406544ae76554600e0d31e36c004b4118be005 100644
--- a/include/gpu/GrTextContext.h
+++ b/include/gpu/GrTextContext.h
@@ -30,6 +30,8 @@ public:
const SkScalar pos[], SkScalar constY,
int scalarsPerPosition) = 0;
+ static bool CanDraw(const SkPaint&, const SkMatrix&) { return false; }
reed1 2014/01/29 17:18:56 all of these static-but-appear-to-be-overrides ver
jvanverth1 2014/01/29 19:25:59 I've removed this one. I left the others as static
+
protected:
GrTextContext(GrContext*, const GrPaint&, const SkPaint&, const SkDeviceProperties&);
@@ -55,6 +57,7 @@ public:
virtual ~GrTextContextManager() {}
virtual GrTextContext* create(GrContext* grContext, const GrPaint& grPaint,
const SkPaint& skPaint, const SkDeviceProperties& props) = 0;
+ virtual bool canDraw(const SkPaint& paint, const SkMatrix& ctm) = 0;
};
template <class TextContextClass>
@@ -110,6 +113,10 @@ public:
return obj;
}
+ virtual bool canDraw(const SkPaint& paint, const SkMatrix& ctm) SK_OVERRIDE {
+ return TextContextClass::CanDraw(paint, ctm);
+ }
+
private:
void recycle(GrTextContext* textContext) {
SkASSERT((void*)textContext == fAllocation);

Powered by Google App Engine
This is Rietveld 408576698