summaryrefslogtreecommitdiffstats
path: root/skia
diff options
context:
space:
mode:
authordcheng <dcheng@chromium.org>2014-12-23 12:06:01 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-23 20:06:49 +0000
commitda6f19cbf485bde27a4c77b18edcab7c06b237bd (patch)
tree1589d16a35c1e2261300028d21df0fad55df56f7 /skia
parent1c3d9acfc574a7bed2f981c00d0025db97c7b28b (diff)
downloadchromium_src-da6f19cbf485bde27a4c77b18edcab7c06b237bd.zip
chromium_src-da6f19cbf485bde27a4c77b18edcab7c06b237bd.tar.gz
chromium_src-da6f19cbf485bde27a4c77b18edcab7c06b237bd.tar.bz2
Standardize usage of virtual/override/final specifiers 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. Several formatting edits by clang-format were manually reverted, due to mangling of some of the more complicate IPC macros. BUG=417463 Review URL: https://codereview.chromium.org/825513002 Cr-Commit-Position: refs/heads/master@{#309579}
Diffstat (limited to 'skia')
-rw-r--r--skia/ext/bitmap_platform_device_cairo.h12
-rw-r--r--skia/ext/pixel_ref_utils_unittest.cc10
2 files changed, 15 insertions, 7 deletions
diff --git a/skia/ext/bitmap_platform_device_cairo.h b/skia/ext/bitmap_platform_device_cairo.h
index 938dd15..977cdad 100644
--- a/skia/ext/bitmap_platform_device_cairo.h
+++ b/skia/ext/bitmap_platform_device_cairo.h
@@ -65,7 +65,7 @@ class BitmapPlatformDevice : public SkBitmapDevice, public PlatformDevice {
//
// This object takes ownership of @cairo.
BitmapPlatformDevice(const SkBitmap& other, cairo_t* cairo);
- virtual ~BitmapPlatformDevice();
+ ~BitmapPlatformDevice() override;
// Constructs a device with size |width| * |height| with contents initialized
// to zero. |is_opaque| should be set if the caller knows the bitmap will be
@@ -84,15 +84,15 @@ class BitmapPlatformDevice : public SkBitmapDevice, public PlatformDevice {
uint8_t* data);
// Overridden from SkBaseDevice:
- virtual void setMatrixClip(const SkMatrix& transform, const SkRegion& region,
- const SkClipStack&) override;
+ void setMatrixClip(const SkMatrix& transform,
+ const SkRegion& region,
+ const SkClipStack&) override;
// Overridden from PlatformDevice:
- virtual cairo_t* BeginPlatformPaint() override;
+ cairo_t* BeginPlatformPaint() override;
protected:
- virtual SkBaseDevice* onCreateCompatibleDevice(const CreateInfo& info)
- override;
+ SkBaseDevice* onCreateCompatibleDevice(const CreateInfo& info) override;
private:
static BitmapPlatformDevice* Create(int width, int height, bool is_opaque,
diff --git a/skia/ext/pixel_ref_utils_unittest.cc b/skia/ext/pixel_ref_utils_unittest.cc
index 08e5d3e..414a3ce 100644
--- a/skia/ext/pixel_ref_utils_unittest.cc
+++ b/skia/ext/pixel_ref_utils_unittest.cc
@@ -47,7 +47,15 @@ class TestDiscardableShader : public SkShader {
void flatten(SkWriteBuffer&) const override {}
- SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(TestDiscardableShader);
+ // Manual expansion of SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS to
+ // satisfy Chrome's style checker, since Skia isn't ready to make the C++11
+ // leap yet.
+ private:
+ static SkFlattenable* CreateProc(SkReadBuffer&);
+ friend class SkPrivateEffectInitializer;
+
+ public:
+ Factory getFactory() const override { return CreateProc; }
private:
SkBitmap bitmap_;