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

Unified Diff: src/utils/SkDeferredCanvas.cpp

Issue 163183011: Revert of have DeferredDevice inherit from SkBaseDevice (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkDeferredCanvas.cpp
diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp
index af604a2119e3ee712bd0a174cf6fa1afc8fa4365..efc65463b52181a75aee7c854f22b0893e37670d 100644
--- a/src/utils/SkDeferredCanvas.cpp
+++ b/src/utils/SkDeferredCanvas.cpp
@@ -137,7 +137,8 @@
//-----------------------------------------------------------------------------
// DeferredDevice
//-----------------------------------------------------------------------------
-class DeferredDevice : public SkBaseDevice {
+// FIXME: Derive from SkBaseDevice.
+class DeferredDevice : public SkBitmapDevice {
public:
explicit DeferredDevice(SkSurface* surface);
~DeferredDevice();
@@ -162,10 +163,6 @@
virtual uint32_t getDeviceCapabilities() SK_OVERRIDE;
virtual int width() const SK_OVERRIDE;
virtual int height() const SK_OVERRIDE;
- virtual SkBitmap::Config config() const SK_OVERRIDE;
- virtual bool isOpaque() const SK_OVERRIDE;
- virtual SkImageInfo imageInfo() const SK_OVERRIDE;
-
virtual GrRenderTarget* accessRenderTarget() SK_OVERRIDE;
virtual SkBaseDevice* onCreateCompatibleDevice(SkBitmap::Config config,
@@ -202,11 +199,9 @@
virtual void drawRect(const SkDraw&, const SkRect& r,
const SkPaint& paint) SK_OVERRIDE
{SkASSERT(0);}
- virtual void drawOval(const SkDraw&, const SkRect&, const SkPaint&) SK_OVERRIDE
- {SkASSERT(0);}
virtual void drawRRect(const SkDraw&, const SkRRect& rr,
const SkPaint& paint) SK_OVERRIDE
- {SkASSERT(0);}
+ {SkASSERT(0);}
virtual void drawPath(const SkDraw&, const SkPath& path,
const SkPaint& paint,
const SkMatrix* prePathMatrix = NULL,
@@ -214,10 +209,6 @@
{SkASSERT(0);}
virtual void drawBitmap(const SkDraw&, const SkBitmap& bitmap,
const SkMatrix& matrix, const SkPaint& paint) SK_OVERRIDE
- {SkASSERT(0);}
- virtual void drawBitmapRect(const SkDraw&, const SkBitmap&, const SkRect*,
- const SkRect&, const SkPaint&,
- SkCanvas::DrawBitmapRectFlags) SK_OVERRIDE
{SkASSERT(0);}
virtual void drawSprite(const SkDraw&, const SkBitmap& bitmap,
int x, int y, const SkPaint& paint) SK_OVERRIDE
@@ -243,24 +234,8 @@
virtual void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y,
const SkPaint&) SK_OVERRIDE
{SkASSERT(0);}
-
- virtual void lockPixels() SK_OVERRIDE { SkASSERT(0); }
- virtual void unlockPixels() SK_OVERRIDE { SkASSERT(0); }
-
- virtual bool allowImageFilter(const SkImageFilter*) SK_OVERRIDE {
- return false;
- }
- virtual bool canHandleImageFilter(const SkImageFilter*) SK_OVERRIDE {
- return false;
- }
- virtual bool filterImage(const SkImageFilter*, const SkBitmap&,
- const SkMatrix&, SkBitmap*, SkIPoint*) SK_OVERRIDE {
- return false;
- }
-
private:
virtual void flush() SK_OVERRIDE;
- virtual void replaceBitmapBackendForRasterSurface(const SkBitmap&) SK_OVERRIDE {}
void beginRecording();
void init();
@@ -280,7 +255,12 @@
size_t fBitmapSizeThreshold;
};
-DeferredDevice::DeferredDevice(SkSurface* surface) {
+DeferredDevice::DeferredDevice(SkSurface* surface)
+ : SkBitmapDevice(SkBitmap::kNo_Config,
+ surface->getCanvas()->getDevice()->width(),
+ surface->getCanvas()->getDevice()->height(),
+ surface->getCanvas()->getDevice()->isOpaque(),
+ surface->getCanvas()->getDevice()->getDeviceProperties()) {
fMaxRecordingStorageBytes = kDefaultMaxRecordingStorageBytes;
fNotificationClient = NULL;
fImmediateCanvas = NULL;
@@ -445,18 +425,6 @@
int DeferredDevice::height() const {
return immediateDevice()->height();
-}
-
-SkBitmap::Config DeferredDevice::config() const {
- return immediateDevice()->config();
-}
-
-bool DeferredDevice::isOpaque() const {
- return immediateDevice()->isOpaque();
-}
-
-SkImageInfo DeferredDevice::imageInfo() const {
- return immediateDevice()->imageInfo();
}
GrRenderTarget* DeferredDevice::accessRenderTarget() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698