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

Unified Diff: include/core/SkDevice.h

Issue 723743002: move to modify onCreateDevice virtual (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/SkBitmapDevice.h ('k') | include/pdf/SkPDFDevice.h » ('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 4a61321ff76203b2e2264de518d6bd1cadefa753..1e39e00526d86e3c4ef125dca72f4a1260b33a62 100644
--- a/include/core/SkDevice.h
+++ b/include/core/SkDevice.h
@@ -340,6 +340,17 @@ protected:
void setPixelGeometry(SkPixelGeometry geo);
+ struct CreateInfo {
+ CreateInfo(const SkImageInfo& info, Usage usage) : fInfo(info), fUsage(usage) {}
+
+ SkImageInfo fInfo;
+ Usage fUsage;
+ };
+ virtual SkBaseDevice* onCreateCompatibleDevice(const CreateInfo& cinfo) {
+ // call deprecated method until we can update chrome's subclasses
+ return this->onCreateDevice(cinfo.fInfo, cinfo.fUsage);
+ }
+
private:
friend class SkCanvas;
friend struct DeviceCM; //for setMatrixClip
@@ -366,6 +377,7 @@ private:
// just called by SkCanvas for imagefilter
SkBaseDevice* createCompatibleDeviceForImageFilter(const SkImageInfo&);
+ // DEPRECATED -- override onCreateCompatibleDevice instead.
virtual SkBaseDevice* onCreateDevice(const SkImageInfo&, Usage) {
return NULL;
}
« no previous file with comments | « include/core/SkBitmapDevice.h ('k') | include/pdf/SkPDFDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698