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

Unified Diff: src/utils/SkGatherPixelRefsAndRects.h

Issue 168653002: Change device factories to take SkImageInfo instead of SkBitmap::Config (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fix PdfViewer Created 6 years, 10 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 | « src/utils/SkDeferredCanvas.cpp ('k') | src/utils/SkPictureUtils.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkGatherPixelRefsAndRects.h
diff --git a/src/utils/SkGatherPixelRefsAndRects.h b/src/utils/SkGatherPixelRefsAndRects.h
index 51595259399dee09722723918d52f89755efa6bb..90ab0f6cffcae0c84fc73fcc9a022cbfc106c4ea 100644
--- a/src/utils/SkGatherPixelRefsAndRects.h
+++ b/src/utils/SkGatherPixelRefsAndRects.h
@@ -28,7 +28,9 @@ public:
fSize.set(width, height);
fPRCont = prCont;
SkSafeRef(fPRCont);
- fEmptyBitmap.setConfig(SkBitmap::kNo_Config, width, height);
+ fEmptyBitmap.setConfig(SkImageInfo::Make(width, height,
+ kUnknown_SkColorType,
+ kIgnore_SkAlphaType));
}
virtual ~SkGatherPixelRefsAndRectsDevice() {
@@ -43,6 +45,10 @@ public:
virtual SkBitmap::Config config() const SK_OVERRIDE {
return SkBitmap::kNo_Config;
}
+ virtual SkImageInfo imageInfo() const SK_OVERRIDE {
+ return fEmptyBitmap.info();
+ }
+
virtual void writePixels(const SkBitmap& bitmap, int x, int y,
SkCanvas::Config8888 config8888) SK_OVERRIDE {
NotSupported();
@@ -326,13 +332,11 @@ private:
NotSupported();
}
- virtual SkBaseDevice* onCreateCompatibleDevice(SkBitmap::Config config,
- int width, int height,
- bool isOpaque,
- Usage usage) SK_OVERRIDE {
+ virtual SkBaseDevice* onCreateDevice(const SkImageInfo& info, Usage usage) SK_OVERRIDE {
// we expect to only get called via savelayer, in which case it is fine.
SkASSERT(kSaveLayer_Usage == usage);
- return SkNEW_ARGS(SkGatherPixelRefsAndRectsDevice, (width, height, fPRCont));
+ return SkNEW_ARGS(SkGatherPixelRefsAndRectsDevice,
+ (info.width(), info.height(), fPRCont));
}
virtual void flush() SK_OVERRIDE {}
« no previous file with comments | « src/utils/SkDeferredCanvas.cpp ('k') | src/utils/SkPictureUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698