aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkPixmap.h
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-07-18 10:53:11 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-18 15:50:43 +0000
commit086a427b0cee3862f25c492fc5082ff24105dc53 (patch)
tree79d4311c12309e5bc34950a0131771d3cb8f6171 /include/core/SkPixmap.h
parent918ad9d5f19efdbd57486b8f931f7af197896010 (diff)
guard references to SkColorTable
Bug: skia:6828 Change-Id: I0c8c78e70b118f51cb59dc45675e4ddcd4776108 Reviewed-on: https://skia-review.googlesource.com/24260 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com>
Diffstat (limited to 'include/core/SkPixmap.h')
-rw-r--r--include/core/SkPixmap.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/include/core/SkPixmap.h b/include/core/SkPixmap.h
index b21df6efb6..1ea011b348 100644
--- a/include/core/SkPixmap.h
+++ b/include/core/SkPixmap.h
@@ -12,7 +12,9 @@
#include "SkFilterQuality.h"
#include "SkImageInfo.h"
+#ifdef SK_SUPPORT_LEGACY_COLORTABLE
class SkColorTable;
+#endif
class SkData;
struct SkMask;
@@ -26,15 +28,14 @@ public:
: fPixels(NULL), fRowBytes(0), fInfo(SkImageInfo::MakeUnknown(0, 0))
{}
- SkPixmap(const SkImageInfo& info, const void* addr, size_t rowBytes, SkColorTable* = NULL)
+ SkPixmap(const SkImageInfo& info, const void* addr, size_t rowBytes)
: fPixels(addr), fRowBytes(rowBytes), fInfo(info)
{}
void reset();
- void reset(const SkImageInfo& info, const void* addr, size_t rowBytes,
- SkColorTable* ctable = NULL);
+ void reset(const SkImageInfo& info, const void* addr, size_t rowBytes);
void reset(const SkImageInfo& info) {
- this->reset(info, NULL, 0, NULL);
+ this->reset(info, NULL, 0);
}
// overrides the colorspace in the SkImageInfo of the pixmap
@@ -57,7 +58,6 @@ public:
const SkImageInfo& info() const { return fInfo; }
size_t rowBytes() const { return fRowBytes; }
const void* addr() const { return fPixels; }
- SkColorTable* ctable() const { return nullptr; }
int width() const { return fInfo.width(); }
int height() const { return fInfo.height(); }
@@ -210,6 +210,17 @@ public:
bool erase(SkColor color) const { return this->erase(color, this->bounds()); }
bool erase(const SkColor4f&, const SkIRect* subset = nullptr) const;
+#ifdef SK_SUPPORT_LEGACY_COLORTABLE
+ SkPixmap(const SkImageInfo& info, const void* addr, size_t rowBytes, SkColorTable*)
+ : fPixels(addr), fRowBytes(rowBytes), fInfo(info)
+ {}
+ void reset(const SkImageInfo& info, const void* addr, size_t rowBytes,
+ SkColorTable*) {
+ this->reset(info, addr, rowBytes);
+ }
+ SkColorTable* ctable() const { return nullptr; }
+#endif
+
private:
const void* fPixels;
size_t fRowBytes;