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

Unified Diff: include/core/SkDevice.h

Issue 719253002: rename filterTextFlags to disableLCD (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rename disableLCD to shouldDisableLCD Created 6 years, 1 month 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 | « include/core/SkCanvas.h ('k') | src/core/SkBitmapDevice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkDevice.h
diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h
index 95a6600b636a067c3d769970ab4e2ab7b7c27170..d9354491c08ff57a2f39610cbccd88f7e931c68b 100644
--- a/include/core/SkDevice.h
+++ b/include/core/SkDevice.h
@@ -31,10 +31,9 @@ public:
* Construct a new device.
*/
SkBaseDevice();
+ explicit SkBaseDevice(const SkDeviceProperties&);
virtual ~SkBaseDevice();
- SkBaseDevice* createCompatibleDevice(const SkImageInfo&);
-
SkMetaData& getMetaData();
/**
@@ -118,6 +117,8 @@ public:
#endif
};
+ bool shouldDisableLCD(const SkPaint&) const;
+
protected:
enum Usage {
kGeneral_Usage,
@@ -129,13 +130,7 @@ protected:
uint32_t fFlags; // SkPaint::getFlags()
};
- /**
- * Device may filter the text flags for drawing text here. If it wants to
- * make a change to the specified values, it should write them into the
- * textflags parameter (output) and return true. If the paint is fine as
- * is, then ignore the textflags parameter and return false.
- */
- virtual bool filterTextFlags(const SkPaint& paint, TextFlags*) { return false; }
+ virtual bool onShouldDisableLCD(const SkPaint&) const { return false; }
/**
*
@@ -338,18 +333,27 @@ protected:
virtual bool EXPERIMENTAL_drawPicture(SkCanvas*, const SkPicture*, const SkMatrix*,
const SkPaint*);
- void setPixelGeometry(SkPixelGeometry geo);
-
struct CreateInfo {
- CreateInfo(const SkImageInfo& info, Usage usage) : fInfo(info), fUsage(usage) {}
-
- SkImageInfo fInfo;
- Usage fUsage;
+ static SkPixelGeometry AdjustGeometry(const SkImageInfo&, Usage, SkPixelGeometry geo);
+
+ // The construct may change the pixel geometry based on usage as needed.
+ CreateInfo(const SkImageInfo& info, Usage usage, SkPixelGeometry geo)
+ : fInfo(info)
+ , fUsage(usage)
+ , fPixelGeometry(AdjustGeometry(info, usage, geo))
+ {}
+
+ const SkImageInfo fInfo;
+ const Usage fUsage;
+ const SkPixelGeometry fPixelGeometry;
};
+
virtual SkBaseDevice* onCreateCompatibleDevice(const CreateInfo& cinfo) {
return NULL;
}
+ virtual void initForRootLayer(SkPixelGeometry geo);
+
private:
friend class SkCanvas;
friend struct DeviceCM; //for setMatrixClip
@@ -371,10 +375,6 @@ private:
// just called by SkCanvas when built as a layer
void setOrigin(int x, int y) { fOrigin.set(x, y); }
- // just called by SkCanvas for saveLayer
- SkBaseDevice* createCompatibleDeviceForSaveLayer(const SkImageInfo&);
- // just called by SkCanvas for imagefilter
- SkBaseDevice* createCompatibleDeviceForImageFilter(const SkImageInfo&);
/** Causes any deferred drawing to the device to be completed.
*/
« no previous file with comments | « include/core/SkCanvas.h ('k') | src/core/SkBitmapDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698