Commit 9f927559 authored by dcheng's avatar dcheng Committed by Commit bot

Standardize usage of virtual/override/final in skia/

The Google C++ style guide states:

  Explicitly annotate overrides of virtual functions or virtual
  destructors with an override or (less frequently) final specifier.
  Older (pre-C++11) code will use the virtual keyword as an inferior
  alternative annotation. For clarity, use exactly one of override,
  final, or virtual when declaring an override.

To better conform to these guidelines, the following constructs have
been rewritten:

- if a base class has a virtual destructor, then:
    virtual ~Foo();                   ->  ~Foo() override;
- virtual void Foo() override;        ->  void Foo() override;
- virtual void Foo() override final;  ->  void Foo() final;

This patch was automatically generated. The clang plugin can generate
fixit hints, which are suggested edits when it is 100% sure it knows how
to fix a problem. The hints from the clang plugin were applied to the
source tree using the tool in https://codereview.chromium.org/598073004.

BUG=417463
R=junov@chromium.org

Review URL: https://codereview.chromium.org/665373005

Cr-Commit-Position: refs/heads/master@{#300701}
parent 45bd4345
...@@ -13,12 +13,12 @@ ...@@ -13,12 +13,12 @@
// base::DiscardableMemory. // base::DiscardableMemory.
class SK_API SkDiscardableMemoryChrome : public SkDiscardableMemory { class SK_API SkDiscardableMemoryChrome : public SkDiscardableMemory {
public: public:
virtual ~SkDiscardableMemoryChrome(); ~SkDiscardableMemoryChrome() override;
// SkDiscardableMemory: // SkDiscardableMemory:
virtual bool lock() override; bool lock() override;
virtual void* data() override; void* data() override;
virtual void unlock() override; void unlock() override;
private: private:
friend class SkDiscardableMemory; friend class SkDiscardableMemory;
......
...@@ -18,7 +18,7 @@ namespace skia { ...@@ -18,7 +18,7 @@ namespace skia {
class SK_API AnalysisCanvas : public SkCanvas, public SkDrawPictureCallback { class SK_API AnalysisCanvas : public SkCanvas, public SkDrawPictureCallback {
public: public:
AnalysisCanvas(int width, int height); AnalysisCanvas(int width, int height);
virtual ~AnalysisCanvas(); ~AnalysisCanvas() override;
// Returns true when a SkColor can be used to represent result. // Returns true when a SkColor can be used to represent result.
bool GetColorIfSolid(SkColor* color) const; bool GetColorIfSolid(SkColor* color) const;
...@@ -27,38 +27,40 @@ class SK_API AnalysisCanvas : public SkCanvas, public SkDrawPictureCallback { ...@@ -27,38 +27,40 @@ class SK_API AnalysisCanvas : public SkCanvas, public SkDrawPictureCallback {
void SetForceNotTransparent(bool flag); void SetForceNotTransparent(bool flag);
// SkDrawPictureCallback override. // SkDrawPictureCallback override.
virtual bool abortDrawing() override; bool abortDrawing() override;
// SkCanvas overrides. // SkCanvas overrides.
virtual void clear(SkColor) override; void clear(SkColor) override;
virtual void drawPaint(const SkPaint& paint) override; void drawPaint(const SkPaint& paint) override;
virtual void drawPoints(PointMode, void drawPoints(PointMode,
size_t count, size_t count,
const SkPoint pts[], const SkPoint pts[],
const SkPaint&) override; const SkPaint&) override;
virtual void drawOval(const SkRect&, const SkPaint&) override; void drawOval(const SkRect&, const SkPaint&) override;
virtual void drawRect(const SkRect&, const SkPaint&) override; void drawRect(const SkRect&, const SkPaint&) override;
virtual void drawRRect(const SkRRect&, const SkPaint&) override; void drawRRect(const SkRRect&, const SkPaint&) override;
virtual void drawPath(const SkPath& path, const SkPaint&) override; void drawPath(const SkPath& path, const SkPaint&) override;
virtual void drawBitmap(const SkBitmap&, void drawBitmap(const SkBitmap&,
SkScalar left, SkScalar left,
SkScalar top, SkScalar top,
const SkPaint* paint = NULL) override; const SkPaint* paint = NULL) override;
virtual void drawBitmapRectToRect(const SkBitmap&, void drawBitmapRectToRect(const SkBitmap&,
const SkRect* src, const SkRect* src,
const SkRect& dst, const SkRect& dst,
const SkPaint* paint, const SkPaint* paint,
DrawBitmapRectFlags flags) override; DrawBitmapRectFlags flags) override;
virtual void drawBitmapMatrix(const SkBitmap&, void drawBitmapMatrix(const SkBitmap&,
const SkMatrix&, const SkMatrix&,
const SkPaint* paint = NULL) override; const SkPaint* paint = NULL) override;
virtual void drawBitmapNine(const SkBitmap& bitmap, void drawBitmapNine(const SkBitmap& bitmap,
const SkIRect& center, const SkIRect& center,
const SkRect& dst, const SkRect& dst,
const SkPaint* paint = NULL) override; const SkPaint* paint = NULL) override;
virtual void drawSprite(const SkBitmap&, int left, int top, void drawSprite(const SkBitmap&,
int left,
int top,
const SkPaint* paint = NULL) override; const SkPaint* paint = NULL) override;
virtual void drawVertices(VertexMode, void drawVertices(VertexMode,
int vertexCount, int vertexCount,
const SkPoint vertices[], const SkPoint vertices[],
const SkPoint texs[], const SkPoint texs[],
...@@ -69,48 +71,47 @@ class SK_API AnalysisCanvas : public SkCanvas, public SkDrawPictureCallback { ...@@ -69,48 +71,47 @@ class SK_API AnalysisCanvas : public SkCanvas, public SkDrawPictureCallback {
const SkPaint&) override; const SkPaint&) override;
protected: protected:
virtual void willSave() override; void willSave() override;
virtual SaveLayerStrategy willSaveLayer(const SkRect*, SaveLayerStrategy willSaveLayer(const SkRect*,
const SkPaint*, const SkPaint*,
SaveFlags) override; SaveFlags) override;
virtual void willRestore() override; void willRestore() override;
virtual void onClipRect(const SkRect& rect, void onClipRect(const SkRect& rect,
SkRegion::Op op, SkRegion::Op op,
ClipEdgeStyle edge_style) override; ClipEdgeStyle edge_style) override;
virtual void onClipRRect(const SkRRect& rrect, void onClipRRect(const SkRRect& rrect,
SkRegion::Op op, SkRegion::Op op,
ClipEdgeStyle edge_style) override; ClipEdgeStyle edge_style) override;
virtual void onClipPath(const SkPath& path, void onClipPath(const SkPath& path,
SkRegion::Op op, SkRegion::Op op,
ClipEdgeStyle edge_style) override; ClipEdgeStyle edge_style) override;
virtual void onClipRegion(const SkRegion& deviceRgn, void onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) override;
SkRegion::Op op) override;
virtual void onDrawText(const void* text, void onDrawText(const void* text,
size_t byteLength, size_t byteLength,
SkScalar x, SkScalar x,
SkScalar y, SkScalar y,
const SkPaint&) override; const SkPaint&) override;
virtual void onDrawPosText(const void* text, void onDrawPosText(const void* text,
size_t byteLength, size_t byteLength,
const SkPoint pos[], const SkPoint pos[],
const SkPaint&) override; const SkPaint&) override;
virtual void onDrawPosTextH(const void* text, void onDrawPosTextH(const void* text,
size_t byteLength, size_t byteLength,
const SkScalar xpos[], const SkScalar xpos[],
SkScalar constY, SkScalar constY,
const SkPaint&) override; const SkPaint&) override;
virtual void onDrawTextOnPath(const void* text, void onDrawTextOnPath(const void* text,
size_t byteLength, size_t byteLength,
const SkPath& path, const SkPath& path,
const SkMatrix* matrix, const SkMatrix* matrix,
const SkPaint&) override; const SkPaint&) override;
virtual void onDrawTextBlob(const SkTextBlob* blob, void onDrawTextBlob(const SkTextBlob* blob,
SkScalar x, SkScalar x,
SkScalar y, SkScalar y,
const SkPaint& paint) override; const SkPaint& paint) override;
virtual void onDrawDRRect(const SkRRect& outer, void onDrawDRRect(const SkRRect& outer,
const SkRRect& inner, const SkRRect& inner,
const SkPaint&) override; const SkPaint&) override;
......
...@@ -29,8 +29,7 @@ public: ...@@ -29,8 +29,7 @@ public:
setProxy(canvas_.get()); setProxy(canvas_.get());
} }
virtual ~TimingCanvas() { ~TimingCanvas() override {}
}
double GetTime(size_t index) { double GetTime(size_t index) {
TimingsMap::const_iterator timing_info = timings_map_.find(index); TimingsMap::const_iterator timing_info = timings_map_.find(index);
...@@ -40,61 +39,66 @@ public: ...@@ -40,61 +39,66 @@ public:
} }
// SkCanvas overrides. // SkCanvas overrides.
virtual void willSave() override { void willSave() override {
AutoStamper stamper(this); AutoStamper stamper(this);
SkProxyCanvas::willSave(); SkProxyCanvas::willSave();
} }
virtual SaveLayerStrategy willSaveLayer(const SkRect* bounds, SaveLayerStrategy willSaveLayer(const SkRect* bounds,
const SkPaint* paint, const SkPaint* paint,
SaveFlags flags) override { SaveFlags flags) override {
AutoStamper stamper(this); AutoStamper stamper(this);
return SkProxyCanvas::willSaveLayer(bounds, paint, flags); return SkProxyCanvas::willSaveLayer(bounds, paint, flags);
} }
virtual void willRestore() override { void willRestore() override {
AutoStamper stamper(this); AutoStamper stamper(this);
SkProxyCanvas::willRestore(); SkProxyCanvas::willRestore();
} }
virtual void drawPaint(const SkPaint& paint) override { void drawPaint(const SkPaint& paint) override {
AutoStamper stamper(this); AutoStamper stamper(this);
SkProxyCanvas::drawPaint(paint); SkProxyCanvas::drawPaint(paint);
} }
virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[], void drawPoints(PointMode mode,
size_t count,
const SkPoint pts[],
const SkPaint& paint) override { const SkPaint& paint) override {
AutoStamper stamper(this); AutoStamper stamper(this);
SkProxyCanvas::drawPoints(mode, count, pts, paint); SkProxyCanvas::drawPoints(mode, count, pts, paint);
} }
virtual void drawOval(const SkRect& rect, const SkPaint& paint) override { void drawOval(const SkRect& rect, const SkPaint& paint) override {
AutoStamper stamper(this); AutoStamper stamper(this);
SkProxyCanvas::drawOval(rect, paint); SkProxyCanvas::drawOval(rect, paint);
} }
virtual void drawRect(const SkRect& rect, const SkPaint& paint) override { void drawRect(const SkRect& rect, const SkPaint& paint) override {
AutoStamper stamper(this); AutoStamper stamper(this);
SkProxyCanvas::drawRect(rect, paint); SkProxyCanvas::drawRect(rect, paint);
} }
virtual void drawRRect(const SkRRect& rrect, const SkPaint& paint) override { void drawRRect(const SkRRect& rrect, const SkPaint& paint) override {
AutoStamper stamper(this); AutoStamper stamper(this);
SkProxyCanvas::drawRRect(rrect, paint); SkProxyCanvas::drawRRect(rrect, paint);
} }
virtual void drawPath(const SkPath& path, const SkPaint& paint) override { void drawPath(const SkPath& path, const SkPaint& paint) override {
AutoStamper stamper(this); AutoStamper stamper(this);
SkProxyCanvas::drawPath(path, paint); SkProxyCanvas::drawPath(path, paint);
} }
virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top, void drawBitmap(const SkBitmap& bitmap,
SkScalar left,
SkScalar top,
const SkPaint* paint = NULL) override { const SkPaint* paint = NULL) override {
AutoStamper stamper(this); AutoStamper stamper(this);
SkProxyCanvas::drawBitmap(bitmap, left, top, paint); SkProxyCanvas::drawBitmap(bitmap, left, top, paint);
} }
virtual void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src, void drawBitmapRectToRect(const SkBitmap& bitmap,
const SkRect* src,
const SkRect& dst, const SkRect& dst,
const SkPaint* paint, const SkPaint* paint,
DrawBitmapRectFlags flags) override { DrawBitmapRectFlags flags) override {
...@@ -102,86 +106,104 @@ public: ...@@ -102,86 +106,104 @@ public:
SkProxyCanvas::drawBitmapRectToRect(bitmap, src, dst, paint, flags); SkProxyCanvas::drawBitmapRectToRect(bitmap, src, dst, paint, flags);
} }
virtual void drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& m, void drawBitmapMatrix(const SkBitmap& bitmap,
const SkMatrix& m,
const SkPaint* paint = NULL) override { const SkPaint* paint = NULL) override {
AutoStamper stamper(this); AutoStamper stamper(this);
SkProxyCanvas::drawBitmapMatrix(bitmap, m, paint); SkProxyCanvas::drawBitmapMatrix(bitmap, m, paint);
} }
virtual void drawSprite(const SkBitmap& bitmap, int left, int top, void drawSprite(const SkBitmap& bitmap,
int left,
int top,
const SkPaint* paint = NULL) override { const SkPaint* paint = NULL) override {
AutoStamper stamper(this); AutoStamper stamper(this);
SkProxyCanvas::drawSprite(bitmap, left, top, paint); SkProxyCanvas::drawSprite(bitmap, left, top, paint);
} }
virtual void drawVertices(VertexMode vmode, int vertexCount, void drawVertices(VertexMode vmode,
const SkPoint vertices[], const SkPoint texs[], int vertexCount,
const SkColor colors[], SkXfermode* xmode, const SkPoint vertices[],
const uint16_t indices[], int indexCount, const SkPoint texs[],
const SkColor colors[],
SkXfermode* xmode,
const uint16_t indices[],
int indexCount,
const SkPaint& paint) override { const SkPaint& paint) override {
AutoStamper stamper(this); AutoStamper stamper(this);
SkProxyCanvas::drawVertices(vmode, vertexCount, vertices, texs, colors, SkProxyCanvas::drawVertices(vmode, vertexCount, vertices, texs, colors,
xmode, indices, indexCount, paint); xmode, indices, indexCount, paint);
} }
virtual void drawData(const void* data, size_t length) override { void drawData(const void* data, size_t length) override {
AutoStamper stamper(this); AutoStamper stamper(this);
SkProxyCanvas::drawData(data, length); SkProxyCanvas::drawData(data, length);
} }
protected: protected:
virtual void onDrawText(const void* text, size_t byteLength, SkScalar x, void onDrawText(const void* text,
SkScalar y, const SkPaint& paint) override { size_t byteLength,
SkScalar x,
SkScalar y,
const SkPaint& paint) override {
AutoStamper stamper(this); AutoStamper stamper(this);
SkProxyCanvas::onDrawText(text, byteLength, x, y, paint); SkProxyCanvas::onDrawText(text, byteLength, x, y, paint);
} }
virtual void onDrawPosText(const void* text, size_t byteLength, void onDrawPosText(const void* text,
size_t byteLength,
const SkPoint pos[], const SkPoint pos[],
const SkPaint& paint) override { const SkPaint& paint) override {
AutoStamper stamper(this); AutoStamper stamper(this);
SkProxyCanvas::onDrawPosText(text, byteLength, pos, paint); SkProxyCanvas::onDrawPosText(text, byteLength, pos, paint);
} }
virtual void onDrawPosTextH(const void* text, size_t byteLength, void onDrawPosTextH(const void* text,
const SkScalar xpos[], SkScalar constY, size_t byteLength,
const SkScalar xpos[],
SkScalar constY,
const SkPaint& paint) override { const SkPaint& paint) override {
AutoStamper stamper(this); AutoStamper stamper(this);
SkProxyCanvas::onDrawPosTextH(text, byteLength, xpos, constY, paint); SkProxyCanvas::onDrawPosTextH(text, byteLength, xpos, constY, paint);
} }
virtual void onDrawTextOnPath(const void* text, size_t byteLength, void onDrawTextOnPath(const void* text,
const SkPath& path, const SkMatrix* matrix, size_t byteLength,
const SkPath& path,
const SkMatrix* matrix,
const SkPaint& paint) override { const SkPaint& paint) override {
AutoStamper stamper(this); AutoStamper stamper(this);
SkProxyCanvas::onDrawTextOnPath(text, byteLength, path, matrix, paint); SkProxyCanvas::onDrawTextOnPath(text, byteLength, path, matrix, paint);
} }
virtual void onClipRect(const SkRect& rect, SkRegion::Op op, void onClipRect(const SkRect& rect,
SkRegion::Op op,
ClipEdgeStyle edge_style) override { ClipEdgeStyle edge_style) override {
AutoStamper stamper(this); AutoStamper stamper(this);
SkProxyCanvas::onClipRect(rect, op, edge_style); SkProxyCanvas::onClipRect(rect, op, edge_style);
} }
virtual void onClipRRect(const SkRRect& rrect, SkRegion::Op op, void onClipRRect(const SkRRect& rrect,
SkRegion::Op op,
ClipEdgeStyle edge_style) override { ClipEdgeStyle edge_style) override {
AutoStamper stamper(this); AutoStamper stamper(this);
SkProxyCanvas::onClipRRect(rrect, op, edge_style); SkProxyCanvas::onClipRRect(rrect, op, edge_style);
} }
virtual void onClipPath(const SkPath& path, SkRegion::Op op, void onClipPath(const SkPath& path,
SkRegion::Op op,
ClipEdgeStyle edge_style) override { ClipEdgeStyle edge_style) override {
AutoStamper stamper(this); AutoStamper stamper(this);
SkProxyCanvas::onClipPath(path, op, edge_style); SkProxyCanvas::onClipPath(path, op, edge_style);
} }
virtual void onClipRegion(const SkRegion& region, void onClipRegion(const SkRegion& region, SkRegion::Op op) override {
SkRegion::Op op) override {
AutoStamper stamper(this); AutoStamper stamper(this);
SkProxyCanvas::onClipRegion(region, op); SkProxyCanvas::onClipRegion(region, op);
} }
virtual void onDrawPicture(const SkPicture* picture, const SkMatrix* matrix, void onDrawPicture(const SkPicture* picture,
const SkMatrix* matrix,
const SkPaint* paint) override { const SkPaint* paint) override {
AutoStamper stamper(this); AutoStamper stamper(this);
SkProxyCanvas::onDrawPicture(picture, matrix, paint); SkProxyCanvas::onDrawPicture(picture, matrix, paint);
......
...@@ -17,7 +17,7 @@ class TimingCanvas; ...@@ -17,7 +17,7 @@ class TimingCanvas;
class SK_API BenchmarkingCanvas : public SkNWayCanvas { class SK_API BenchmarkingCanvas : public SkNWayCanvas {
public: public:
BenchmarkingCanvas(int width, int height); BenchmarkingCanvas(int width, int height);
virtual ~BenchmarkingCanvas(); ~BenchmarkingCanvas() override;
// Returns the number of draw commands executed on this canvas. // Returns the number of draw commands executed on this canvas.
size_t CommandCount() const; size_t CommandCount() const;
......
...@@ -48,23 +48,25 @@ class SK_API BitmapPlatformDevice : public SkBitmapDevice, public PlatformDevice ...@@ -48,23 +48,25 @@ class SK_API BitmapPlatformDevice : public SkBitmapDevice, public PlatformDevice
int width, int height, int width, int height,
bool is_opaque); bool is_opaque);
virtual ~BitmapPlatformDevice(); ~BitmapPlatformDevice() override;
// PlatformDevice overrides // PlatformDevice overrides
virtual CGContextRef GetBitmapContext() override; CGContextRef GetBitmapContext() override;
virtual void DrawToNativeContext(CGContextRef context, int x, int y, void DrawToNativeContext(CGContextRef context,
int x,
int y,
const CGRect* src_rect) override; const CGRect* src_rect) override;
// SkBaseDevice overrides // SkBaseDevice overrides
virtual void setMatrixClip(const SkMatrix& transform, const SkRegion& region, void setMatrixClip(const SkMatrix& transform,
const SkRegion& region,
const SkClipStack&) override; const SkClipStack&) override;
protected: protected:
BitmapPlatformDevice(CGContextRef context, BitmapPlatformDevice(CGContextRef context,
const SkBitmap& bitmap); const SkBitmap& bitmap);
virtual SkBaseDevice* onCreateDevice(const SkImageInfo& info, SkBaseDevice* onCreateDevice(const SkImageInfo& info, Usage usage) override;
Usage usage) override;
private: private:
void ReleaseBitmapContext(); void ReleaseBitmapContext();
......
...@@ -9,11 +9,9 @@ ...@@ -9,11 +9,9 @@
namespace skia { namespace skia {
class SkChromiumEventTracer: public SkEventTracer { class SkChromiumEventTracer: public SkEventTracer {
virtual const uint8_t* getCategoryGroupEnabled(const char* name) override; const uint8_t* getCategoryGroupEnabled(const char* name) override;
virtual const char* getCategoryGroupName( const char* getCategoryGroupName(const uint8_t* categoryEnabledFlag) override;
const uint8_t* categoryEnabledFlag) override; SkEventTracer::Handle addTraceEvent(char phase,
virtual SkEventTracer::Handle
addTraceEvent(char phase,
const uint8_t* categoryEnabledFlag, const uint8_t* categoryEnabledFlag,
const char* name, const char* name,
uint64_t id, uint64_t id,
...@@ -22,9 +20,8 @@ class SkChromiumEventTracer: public SkEventTracer { ...@@ -22,9 +20,8 @@ class SkChromiumEventTracer: public SkEventTracer {
const uint8_t* argTypes, const uint8_t* argTypes,
const uint64_t* argValues, const uint64_t* argValues,
uint8_t flags) override; uint8_t flags) override;
virtual void void updateTraceEventDuration(const uint8_t* categoryEnabledFlag,
updateTraceEventDuration(const uint8_t* categoryEnabledFlag, const char* name,
const char *name,
SkEventTracer::Handle handle) override; SkEventTracer::Handle handle) override;
}; };
......
...@@ -15,7 +15,7 @@ namespace skia { ...@@ -15,7 +15,7 @@ namespace skia {
class SK_API LazyPixelRef : public SkPixelRef { class SK_API LazyPixelRef : public SkPixelRef {
public: public:
explicit LazyPixelRef(const SkImageInfo& info); explicit LazyPixelRef(const SkImageInfo& info);
virtual ~LazyPixelRef(); ~LazyPixelRef() override;
struct PrepareParams { struct PrepareParams {
// Clipping rect for this pixel ref. // Clipping rect for this pixel ref.
......
...@@ -19,8 +19,8 @@ namespace skia { ...@@ -19,8 +19,8 @@ namespace skia {
class SK_API OpacityDrawFilter : public SkDrawFilter { class SK_API OpacityDrawFilter : public SkDrawFilter {
public: public:
OpacityDrawFilter(float opacity, bool disable_image_filtering); OpacityDrawFilter(float opacity, bool disable_image_filtering);
virtual ~OpacityDrawFilter(); ~OpacityDrawFilter() override;
virtual bool filter(SkPaint* paint, SkDrawFilter::Type type) override; bool filter(SkPaint* paint, SkDrawFilter::Type type) override;
private: private:
int alpha_; int alpha_;
......
...@@ -51,8 +51,8 @@ class GatherPixelRefDevice : public SkBitmapDevice { ...@@ -51,8 +51,8 @@ class GatherPixelRefDevice : public SkBitmapDevice {
DiscardablePixelRefSet* pixel_ref_set) DiscardablePixelRefSet* pixel_ref_set)
: SkBitmapDevice(bm), pixel_ref_set_(pixel_ref_set) {} : SkBitmapDevice(bm), pixel_ref_set_(pixel_ref_set) {}
virtual void clear(SkColor color) override {} void clear(SkColor color) override {}
virtual void drawPaint(const SkDraw& draw, const SkPaint& paint) override { void drawPaint(const SkDraw& draw, const SkPaint& paint) override {
SkBitmap bitmap; SkBitmap bitmap;
if (GetBitmapFromPaint(paint, &bitmap)) { if (GetBitmapFromPaint(paint, &bitmap)) {
SkRect clip_rect = SkRect::Make(draw.fRC->getBounds()); SkRect clip_rect = SkRect::Make(draw.fRC->getBounds());
...@@ -60,7 +60,7 @@ class GatherPixelRefDevice : public SkBitmapDevice { ...@@ -60,7 +60,7 @@ class GatherPixelRefDevice : public SkBitmapDevice {
} }
} }
virtual void drawPoints(const SkDraw& draw, void drawPoints(const SkDraw& draw,
SkCanvas::PointMode mode, SkCanvas::PointMode mode,
size_t count, size_t count,
const SkPoint points[], const SkPoint points[],
...@@ -87,7 +87,7 @@ class GatherPixelRefDevice : public SkBitmapDevice { ...@@ -87,7 +87,7 @@ class GatherPixelRefDevice : public SkBitmapDevice {
GatherPixelRefDevice::drawRect(draw, bounds, paint); GatherPixelRefDevice::drawRect(draw, bounds, paint);
} }
virtual void drawRect(const SkDraw& draw, void drawRect(const SkDraw& draw,
const SkRect& rect, const SkRect& rect,
const SkPaint& paint) override { const SkPaint& paint) override {
SkBitmap bitmap; SkBitmap bitmap;
...@@ -98,17 +98,17 @@ class GatherPixelRefDevice : public SkBitmapDevice { ...@@ -98,17 +98,17 @@ class GatherPixelRefDevice : public SkBitmapDevice {
AddBitmap(bitmap, mapped_rect); AddBitmap(bitmap, mapped_rect);
} }
} }
virtual void drawOval(const SkDraw& draw, void drawOval(const SkDraw& draw,
const SkRect& rect, const SkRect& rect,
const SkPaint& paint) override { const SkPaint& paint) override {
GatherPixelRefDevice::drawRect(draw, rect, paint); GatherPixelRefDevice::drawRect(draw, rect, paint);
} }
virtual void drawRRect(const SkDraw& draw, void drawRRect(const SkDraw& draw,
const SkRRect& rect, const SkRRect& rect,
const SkPaint& paint) override { const SkPaint& paint) override {
GatherPixelRefDevice::drawRect(draw, rect.rect(), paint); GatherPixelRefDevice::drawRect(draw, rect.rect(), paint);
} }
virtual void drawPath(const SkDraw& draw, void drawPath(const SkDraw& draw,
const SkPath& path, const SkPath& path,
const SkPaint& paint, const SkPaint& paint,
const SkMatrix* pre_path_matrix, const SkMatrix* pre_path_matrix,
...@@ -126,7 +126,7 @@ class GatherPixelRefDevice : public SkBitmapDevice { ...@@ -126,7 +126,7 @@ class GatherPixelRefDevice : public SkBitmapDevice {
GatherPixelRefDevice::drawRect(draw, final_rect, paint); GatherPixelRefDevice::drawRect(draw, final_rect, paint);
} }
virtual void drawBitmap(const SkDraw& draw, void drawBitmap(const SkDraw& draw,
const SkBitmap& bitmap, const SkBitmap& bitmap,
const SkMatrix& matrix, const SkMatrix& matrix,
const SkPaint& paint) override { const SkPaint& paint) override {
...@@ -142,7 +142,7 @@ class GatherPixelRefDevice : public SkBitmapDevice { ...@@ -142,7 +142,7 @@ class GatherPixelRefDevice : public SkBitmapDevice {
if (GetBitmapFromPaint(paint, &paint_bitmap)) if (GetBitmapFromPaint(paint, &paint_bitmap))
AddBitmap(paint_bitmap, mapped_rect); AddBitmap(paint_bitmap, mapped_rect);
} }
virtual void drawBitmapRect(const SkDraw& draw, void drawBitmapRect(const SkDraw& draw,
const SkBitmap& bitmap, const SkBitmap& bitmap,
const SkRect* src_or_null, const SkRect* src_or_null,
const SkRect& dst, const SkRect& dst,
...@@ -153,7 +153,7 @@ class GatherPixelRefDevice : public SkBitmapDevice { ...@@ -153,7 +153,7 @@ class GatherPixelRefDevice : public SkBitmapDevice {
matrix.setRectToRect(bitmap_rect, dst, SkMatrix::kFill_ScaleToFit); matrix.setRectToRect(bitmap_rect, dst, SkMatrix::kFill_ScaleToFit);
GatherPixelRefDevice::drawBitmap(draw, bitmap, matrix, paint); GatherPixelRefDevice::drawBitmap(draw, bitmap, matrix, paint);
} }
virtual void drawSprite(const SkDraw& draw, void drawSprite(const SkDraw& draw,
const SkBitmap& bitmap, const SkBitmap& bitmap,
int x, int x,
int y, int y,
...@@ -171,7 +171,7 @@ class GatherPixelRefDevice : public SkBitmapDevice { ...@@ -171,7 +171,7 @@ class GatherPixelRefDevice : public SkBitmapDevice {
if (GetBitmapFromPaint(paint, &paint_bitmap)) if (GetBitmapFromPaint(paint, &paint_bitmap))
AddBitmap(paint_bitmap, mapped_rect); AddBitmap(paint_bitmap, mapped_rect);
} }
virtual void drawText(const SkDraw& draw, void drawText(const SkDraw& draw,
const void* text, const void* text,
size_t len, size_t len,
SkScalar x, SkScalar x,
...@@ -218,7 +218,7 @@ class GatherPixelRefDevice : public SkBitmapDevice { ...@@ -218,7 +218,7 @@ class GatherPixelRefDevice : public SkBitmapDevice {
GatherPixelRefDevice::drawRect(draw, bounds, paint); GatherPixelRefDevice::drawRect(draw, bounds, paint);
} }
virtual void drawPosText(const SkDraw& draw, void drawPosText(const SkDraw& draw,
const void* text, const void* text,
size_t len, size_t len,
const SkScalar pos[], const SkScalar pos[],
...@@ -263,7 +263,7 @@ class GatherPixelRefDevice : public SkBitmapDevice { ...@@ -263,7 +263,7 @@ class GatherPixelRefDevice : public SkBitmapDevice {
GatherPixelRefDevice::drawRect(draw, bounds, paint); GatherPixelRefDevice::drawRect(draw, bounds, paint);
} }
virtual void drawTextOnPath(const SkDraw& draw, void drawTextOnPath(const SkDraw& draw,
const void* text, const void* text,
size_t len, size_t len,
const SkPath& path, const SkPath& path,
...@@ -286,7 +286,7 @@ class GatherPixelRefDevice : public SkBitmapDevice { ...@@ -286,7 +286,7 @@ class GatherPixelRefDevice : public SkBitmapDevice {
GatherPixelRefDevice::drawRect(draw, bounds, paint); GatherPixelRefDevice::drawRect(draw, bounds, paint);
} }
virtual void drawVertices(const SkDraw& draw, void drawVertices(const SkDraw& draw,
SkCanvas::VertexMode, SkCanvas::VertexMode,
int vertex_count, int vertex_count,
const SkPoint verts[], const SkPoint verts[],
...@@ -299,14 +299,14 @@ class GatherPixelRefDevice : public SkBitmapDevice { ...@@ -299,14 +299,14 @@ class GatherPixelRefDevice : public SkBitmapDevice {
GatherPixelRefDevice::drawPoints( GatherPixelRefDevice::drawPoints(
draw, SkCanvas::kPolygon_PointMode, vertex_count, verts, paint); draw, SkCanvas::kPolygon_PointMode, vertex_count, verts, paint);
} }
virtual void drawDevice(const SkDraw&, void drawDevice(const SkDraw&,
SkBaseDevice*, SkBaseDevice*,
int x, int x,
int y, int y,
const SkPaint&) override {} const SkPaint&) override {}
protected: protected:
virtual bool onReadPixels(const SkImageInfo& info, bool onReadPixels(const SkImageInfo& info,
void* pixels, void* pixels,
size_t rowBytes, size_t rowBytes,
int x, int x,
...@@ -314,7 +314,7 @@ class GatherPixelRefDevice : public SkBitmapDevice { ...@@ -314,7 +314,7 @@ class GatherPixelRefDevice : public SkBitmapDevice {
return false; return false;
} }
virtual bool onWritePixels(const SkImageInfo& info, bool onWritePixels(const SkImageInfo& info,
const void* pixels, const void* pixels,
size_t rowBytes, size_t rowBytes,
int x, int x,
......
...@@ -34,7 +34,7 @@ class TestDiscardableShader : public SkShader { ...@@ -34,7 +34,7 @@ class TestDiscardableShader : public SkShader {
CreateBitmap(gfx::Size(50, 50), "discardable", &bitmap_); CreateBitmap(gfx::Size(50, 50), "discardable", &bitmap_);
} }
virtual SkShader::BitmapType asABitmap(SkBitmap* bitmap, SkShader::BitmapType asABitmap(SkBitmap* bitmap,
SkMatrix* matrix, SkMatrix* matrix,
TileMode xy[2]) const override { TileMode xy[2]) const override {
if (bitmap) if (bitmap)
...@@ -43,11 +43,9 @@ class TestDiscardableShader : public SkShader { ...@@ -43,11 +43,9 @@ class TestDiscardableShader : public SkShader {
} }
// not indended to return an actual context. Just need to supply this. // not indended to return an actual context. Just need to supply this.
virtual size_t contextSize() const override { size_t contextSize() const override { return sizeof(SkShader::Context); }
return sizeof(SkShader::Context);
}
virtual void flatten(SkWriteBuffer&) const override {} void flatten(SkWriteBuffer&) const override {}
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(TestDiscardableShader); SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(TestDiscardableShader);
......
...@@ -23,24 +23,24 @@ class VectorPlatformDeviceSkia : public SkPDFDevice, public PlatformDevice { ...@@ -23,24 +23,24 @@ class VectorPlatformDeviceSkia : public SkPDFDevice, public PlatformDevice {
SK_API VectorPlatformDeviceSkia(const SkISize& pageSize, SK_API VectorPlatformDeviceSkia(const SkISize& pageSize,
const SkISize& contentSize, const SkISize& contentSize,
const SkMatrix& initialTransform); const SkMatrix& initialTransform);
virtual ~VectorPlatformDeviceSkia(); ~VectorPlatformDeviceSkia() override;
// PlatformDevice methods. // PlatformDevice methods.
virtual bool SupportsPlatformPaint() override; bool SupportsPlatformPaint() override;
virtual PlatformSurface BeginPlatformPaint() override; PlatformSurface BeginPlatformPaint() override;
virtual void EndPlatformPaint() override; void EndPlatformPaint() override;
#if defined(OS_WIN) #if defined(OS_WIN)
virtual void DrawToNativeContext(HDC dc, virtual void DrawToNativeContext(HDC dc,
int x, int x,
int y, int y,
const RECT* src_rect) override; const RECT* src_rect) override;
#elif defined(OS_MACOSX) #elif defined(OS_MACOSX)
virtual void DrawToNativeContext(CGContext* context, void DrawToNativeContext(CGContext* context,
int x, int x,
int y, int y,
const CGRect* src_rect) override; const CGRect* src_rect) override;
virtual CGContextRef GetBitmapContext() override; CGContextRef GetBitmapContext() override;
#elif defined(OS_POSIX) #elif defined(OS_POSIX)
virtual void DrawToNativeContext(PlatformSurface surface, virtual void DrawToNativeContext(PlatformSurface surface,
int x, int x,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment