diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-12-05 12:08:12 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-12-05 12:08:12 +0000 |
commit | ab1c13864df34aecfd4840ea7d1e4f8730b44f4e (patch) | |
tree | a625a37bc45bf55d7327b9f55a11d435058f8778 /src/image | |
parent | 000d732ca70391aa7196efdbaf9992a96ff2fc99 (diff) |
Fix compilation with SK_ENABLE_INST_COUNT=1
Add INHERITED declarations to class declarations that prevent
compilation with the flag.
Remove SK_DEFINE_INST_COUNT from all class implementations. Instead,
use function-local static variables in the reference count helper
classes to create the global instances to store the needed info. The
accessor functions are defined inline in the helper classes, so
definitions are not needed. The initialization point of the variables
should be as well defined as previously.
Remove SK_DECLARE_INST_COUNT_TEMPLATE and use SK_DECLARE_INST_COUNT
instead. This avoids possible future compilation errors further.
For SK_ENABLE_INST_COUNT=0 compilation, add an empty static member
function to all classes that use SK_DECLARE_INST_COUNT and
SK_DECLARE_INST_COUNT_ROOT macros. The function ensures that classes
contain public INHERITED typedef. This member function seems to be
compiled away. This shouĺd ensure that part of the compilation errors
are caught earlier.
Also adds DSK_DECLARE_INST_COUNT to few SkPDFDict subclasses.
R=robertphillips@google.com, richardlin@chromium.org, bsalomon@google.com
Author: kkinnunen@nvidia.com
Review URL: https://codereview.chromium.org/98703002
git-svn-id: http://skia.googlecode.com/svn/trunk@12501 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/image')
-rw-r--r-- | src/image/SkImage.cpp | 2 | ||||
-rw-r--r-- | src/image/SkImage_Gpu.cpp | 2 | ||||
-rw-r--r-- | src/image/SkSurface.cpp | 2 | ||||
-rw-r--r-- | src/image/SkSurface_Gpu.cpp | 2 |
4 files changed, 0 insertions, 8 deletions
diff --git a/src/image/SkImage.cpp b/src/image/SkImage.cpp index 39fd93acc6..620922f645 100644 --- a/src/image/SkImage.cpp +++ b/src/image/SkImage.cpp @@ -10,8 +10,6 @@ #include "SkImagePriv.h" #include "SkImage_Base.h" -SK_DEFINE_INST_COUNT(SkImage) - static SkImage_Base* as_IB(SkImage* image) { return static_cast<SkImage_Base*>(image); } diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp index 036e45bb65..ab0a5237fd 100644 --- a/src/image/SkImage_Gpu.cpp +++ b/src/image/SkImage_Gpu.cpp @@ -36,8 +36,6 @@ private: typedef SkImage_Base INHERITED; }; -SK_DEFINE_INST_COUNT(SkImage_Gpu) - /////////////////////////////////////////////////////////////////////////////// SkImage_Gpu::SkImage_Gpu(const SkBitmap& bitmap) diff --git a/src/image/SkSurface.cpp b/src/image/SkSurface.cpp index 2fd4e1042b..2dde36b96d 100644 --- a/src/image/SkSurface.cpp +++ b/src/image/SkSurface.cpp @@ -9,8 +9,6 @@ #include "SkImagePriv.h" #include "SkCanvas.h" -SK_DEFINE_INST_COUNT(SkSurface) - /////////////////////////////////////////////////////////////////////////////// SkSurface_Base::SkSurface_Base(int width, int height) : INHERITED(width, height) { diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp index e9049aef2e..e673cef670 100644 --- a/src/image/SkSurface_Gpu.cpp +++ b/src/image/SkSurface_Gpu.cpp @@ -31,8 +31,6 @@ private: typedef SkSurface_Base INHERITED; }; -SK_DEFINE_INST_COUNT(SkSurface_Gpu) - /////////////////////////////////////////////////////////////////////////////// SkSurface_Gpu::SkSurface_Gpu(GrContext* ctx, const SkImageInfo& info, |