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

Unified Diff: include/pdf/SkPDFDevice.h

Issue 354133002: change gpudevice and pdfdevice to inherit from basedevice (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: pdfdevice needs to override newSurface Created 6 years, 6 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 | « include/gpu/SkGpuDevice.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/pdf/SkPDFDevice.h
diff --git a/include/pdf/SkPDFDevice.h b/include/pdf/SkPDFDevice.h
index e250a6de4f0658da5f887a30d38d9394d3e30753..bcdcfb24e4a7a7ff59e34e3b7a190119455995e1 100644
--- a/include/pdf/SkPDFDevice.h
+++ b/include/pdf/SkPDFDevice.h
@@ -10,7 +10,7 @@
#ifndef SkPDFDevice_DEFINED
#define SkPDFDevice_DEFINED
-#include "SkBitmapDevice.h"
+#include "SkDevice.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkPaint.h"
@@ -45,7 +45,7 @@ struct NamedDestination;
The drawing context for the PDF backend.
*/
-class SkPDFDevice : public SkBitmapDevice {
+class SkPDFDevice : public SkBaseDevice {
public:
/** Create a PDF drawing context with the given width and height.
* 72 points/in means letter paper is 612x792.
@@ -82,8 +82,8 @@ public:
size_t count, const SkPoint[],
const SkPaint& paint) SK_OVERRIDE;
virtual void drawRect(const SkDraw&, const SkRect& r, const SkPaint& paint);
- virtual void drawRRect(const SkDraw&, const SkRRect& rr,
- const SkPaint& paint) SK_OVERRIDE;
+ virtual void drawOval(const SkDraw&, const SkRect& oval, const SkPaint& paint) SK_OVERRIDE;
+ virtual void drawRRect(const SkDraw&, const SkRRect& rr, const SkPaint& paint) SK_OVERRIDE;
virtual void drawPath(const SkDraw&, const SkPath& origpath,
const SkPaint& paint, const SkMatrix* prePathMatrix,
bool pathIsMutable) SK_OVERRIDE;
@@ -113,6 +113,7 @@ public:
virtual void onAttachToCanvas(SkCanvas* canvas) SK_OVERRIDE;
virtual void onDetachFromCanvas() SK_OVERRIDE;
+ virtual SkImageInfo imageInfo() const SK_OVERRIDE;
enum DrawingArea {
kContent_DrawingArea, // Drawing area for the page content.
@@ -208,7 +209,15 @@ public:
}
protected:
- virtual bool allowImageFilter(const SkImageFilter*) SK_OVERRIDE;
+ virtual const SkBitmap& onAccessBitmap() SK_OVERRIDE {
+ return fLegacyBitmap;
+ }
+
+ virtual bool allowImageFilter(const SkImageFilter*) SK_OVERRIDE {
+ return false;
+ }
+
+ virtual SkSurface* newSurface(const SkImageInfo&) SK_OVERRIDE;
private:
// TODO(vandebo): push most of SkPDFDevice's state into a core object in
@@ -248,6 +257,8 @@ private:
SkPicture::EncodeBitmap fEncoder;
SkScalar fRasterDpi;
+ SkBitmap fLegacyBitmap;
+
SkPDFDevice(const SkISize& layerSize, const SkClipStack& existingClipStack,
const SkRegion& existingClipRegion);
@@ -323,7 +334,7 @@ private:
void defineNamedDestination(SkData* nameData, const SkPoint& point,
const SkMatrix& matrix);
- typedef SkBitmapDevice INHERITED;
+ typedef SkBaseDevice INHERITED;
// TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to create
// an SkPDFDevice
« no previous file with comments | « include/gpu/SkGpuDevice.h ('k') | src/core/SkBitmapDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698