aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-12-07 18:34:08 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-12-07 18:34:08 +0000
commit982cb875f01e247843b9a79082f680cdcf234c2c (patch)
tree8d09237a3e106a1472555ebd80fef98c9f46d56a
parent8e6d914b87a882ebf6ffe8f4be53b86ffec5cf62 (diff)
add SK_OVERRIDE, move subclass impls of virtuals into .cpp
git-svn-id: http://skia.googlecode.com/svn/trunk@2823 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--include/device/xps/SkXPSDevice.h8
-rw-r--r--include/pdf/SkPDFDevice.h34
-rw-r--r--src/device/xps/SkXPSDevice.cpp9
-rw-r--r--src/pdf/SkPDFDevice.cpp9
4 files changed, 35 insertions, 25 deletions
diff --git a/include/device/xps/SkXPSDevice.h b/include/device/xps/SkXPSDevice.h
index 2ba20f0744..c948a902fb 100644
--- a/include/device/xps/SkXPSDevice.h
+++ b/include/device/xps/SkXPSDevice.h
@@ -67,9 +67,7 @@ public:
virtual bool endSheet();
virtual bool endPortfolio();
- virtual uint32_t getDeviceCapabilities() SK_OVERRIDE {
- return kVector_Capability;
- }
+ virtual uint32_t getDeviceCapabilities() SK_OVERRIDE;
protected:
virtual void clear(SkColor color) SK_OVERRIDE;
@@ -144,9 +142,7 @@ protected:
virtual bool onReadPixels(const SkBitmap& bitmap,
int x,
int y,
- SkCanvas::Config8888) SK_OVERRIDE {
- return false;
- }
+ SkCanvas::Config8888) SK_OVERRIDE;
private:
class TypefaceUse : ::SkNoncopyable {
diff --git a/include/pdf/SkPDFDevice.h b/include/pdf/SkPDFDevice.h
index b74e98f0b2..006994e304 100644
--- a/include/pdf/SkPDFDevice.h
+++ b/include/pdf/SkPDFDevice.h
@@ -62,43 +62,43 @@ public:
const SkMatrix& initialTransform);
SK_API virtual ~SkPDFDevice();
- virtual uint32_t getDeviceCapabilities() { return kVector_Capability; }
+ virtual uint32_t getDeviceCapabilities() SK_OVERRIDE;
- virtual void clear(SkColor color);
+ virtual void clear(SkColor color) SK_OVERRIDE;
/** These are called inside the per-device-layer loop for each draw call.
When these are called, we have already applied any saveLayer operations,
and are handling any looping from the paint, and any effects from the
DrawFilter.
*/
- virtual void drawPaint(const SkDraw&, const SkPaint& paint);
+ virtual void drawPaint(const SkDraw&, const SkPaint& paint) SK_OVERRIDE;
virtual void drawPoints(const SkDraw&, SkCanvas::PointMode mode,
size_t count, const SkPoint[],
- const SkPaint& paint);
+ const SkPaint& paint) SK_OVERRIDE;
virtual void drawRect(const SkDraw&, const SkRect& r, const SkPaint& paint);
virtual void drawPath(const SkDraw&, const SkPath& origpath,
const SkPaint& paint, const SkMatrix* prePathMatrix,
- bool pathIsMutable);
+ bool pathIsMutable) SK_OVERRIDE;
virtual void drawBitmap(const SkDraw&, const SkBitmap& bitmap,
const SkIRect* srcRectOrNull,
- const SkMatrix& matrix, const SkPaint& paint);
+ const SkMatrix& matrix, const SkPaint&) SK_OVERRIDE;
virtual void drawSprite(const SkDraw&, const SkBitmap& bitmap, int x, int y,
- const SkPaint& paint);
+ const SkPaint& paint) SK_OVERRIDE;
virtual void drawText(const SkDraw&, const void* text, size_t len,
- SkScalar x, SkScalar y, const SkPaint& paint);
+ SkScalar x, SkScalar y, const SkPaint&) SK_OVERRIDE;
virtual void drawPosText(const SkDraw&, const void* text, size_t len,
const SkScalar pos[], SkScalar constY,
- int scalarsPerPos, const SkPaint& paint);
+ int scalarsPerPos, const SkPaint&) SK_OVERRIDE;
virtual void drawTextOnPath(const SkDraw&, const void* text, size_t len,
const SkPath& path, const SkMatrix* matrix,
- const SkPaint& paint);
+ const SkPaint& paint) SK_OVERRIDE;
virtual void drawVertices(const SkDraw&, SkCanvas::VertexMode,
int vertexCount, const SkPoint verts[],
const SkPoint texs[], const SkColor colors[],
SkXfermode* xmode, const uint16_t indices[],
- int indexCount, const SkPaint& paint);
+ int indexCount, const SkPaint& paint) SK_OVERRIDE;
virtual void drawDevice(const SkDraw&, SkDevice*, int x, int y,
- const SkPaint&);
+ const SkPaint&) SK_OVERRIDE;
enum DrawingArea {
kContent_DrawingArea, // Drawing area for the page content.
@@ -158,12 +158,8 @@ public:
}
protected:
- virtual bool onReadPixels(const SkBitmap& bitmap,
- int x, int y,
- SkCanvas::Config8888) SK_OVERRIDE {
- return false;
- }
-
+ virtual bool onReadPixels(const SkBitmap& bitmap, int x, int y,
+ SkCanvas::Config8888) SK_OVERRIDE;
private:
// TODO(vandebo): push most of SkPDFDevice's state into a core object in
@@ -203,7 +199,7 @@ private:
virtual SkDevice* onCreateCompatibleDevice(SkBitmap::Config config,
int width, int height,
bool isOpaque,
- Usage usage);
+ Usage usage) SK_OVERRIDE;
void init();
void cleanUp(bool clearFontUsage);
diff --git a/src/device/xps/SkXPSDevice.cpp b/src/device/xps/SkXPSDevice.cpp
index eaf61effa3..f9d825424e 100644
--- a/src/device/xps/SkXPSDevice.cpp
+++ b/src/device/xps/SkXPSDevice.cpp
@@ -1119,6 +1119,10 @@ HRESULT SkXPSDevice::createXpsQuad(const SkPoint (&points)[4],
return S_OK;
}
+uint32_t SkXPSDevice::getDeviceCapabilities() {
+ return kVector_Capability;
+}
+
void SkXPSDevice::clear(SkColor color) {
//TODO: override this for XPS
SkDEBUGF(("XPS clear not yet implemented."));
@@ -2362,6 +2366,11 @@ void SkXPSDevice::drawDevice(const SkDraw& d, SkDevice* dev,
"Could not add layer to current visuals.");
}
+bool SkXPSDevice::onReadPixels(const SkBitmap& bitmap, int x, int y,
+ SkCanvas::Config8888) {
+ return false;
+}
+
SkDevice* SkXPSDevice::onCreateCompatibleDevice(SkBitmap::Config config,
int width, int height,
bool isOpaque,
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index 0c1e19a3c1..f46cade14f 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -562,6 +562,10 @@ void SkPDFDevice::cleanUp(bool clearFontUsage) {
}
}
+uint32_t SkPDFDevice::getDeviceCapabilities() {
+ return kVector_Capability;
+}
+
void SkPDFDevice::clear(SkColor color) {
this->cleanUp(true);
this->init();
@@ -1522,3 +1526,8 @@ void SkPDFDevice::internalDrawBitmap(const SkMatrix& matrix,
SkPDFUtils::DrawFormXObject(fXObjectResources.count() - 1,
&content.entry()->fContent);
}
+
+bool SkPDFDevice::onReadPixels(const SkBitmap& bitmap, int x, int y,
+ SkCanvas::Config8888) {
+ return false;
+}