hide SkDevice::config()

TBR=robertphilips

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/302253002
This commit is contained in:
reed 2014-06-02 05:45:31 -07:00 committed by Commit bot
parent 14751dbcf3
commit a6a8f00a39
10 changed files with 20 additions and 0 deletions

View File

@ -14,6 +14,7 @@
#
'skia_for_android_framework_defines': [
'SK_SUPPORT_LEGACY_SETCONFIG_INFO',
'SK_SUPPORT_LEGACY_DEVICE_CONFIG',
# Needed until we fix skbug.com/2440.
'SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG',
# Transitional, for deprecated SkCanvas::SaveFlags methods.

View File

@ -16,6 +16,7 @@
'SK_SUPPORT_LEGACY_GETTOPDEVICE',
'SK_SUPPORT_LEGACY_ASIMAGEINFO',
'SK_SUPPORT_LEGACY_SETCONFIG_INFO',
'SK_SUPPORT_LEGACY_DEVICE_CONFIG',
'SK_SUPPORT_LEGACY_N32_NAME',
'SK_IGNORE_CORRECT_HIGH_QUALITY_IMAGE_SCALE',
'SK_SUPPORT_LEGACY_INSTALLPIXELSPARAMS',

View File

@ -45,9 +45,11 @@ public:
*/
virtual bool isOpaque() const SK_OVERRIDE { return fBitmap.isOpaque(); }
#ifdef SK_SUPPORT_LEGACY_DEVICE_CONFIG
/** Return the bitmap config of the device's pixels
*/
virtual SkBitmap::Config config() const SK_OVERRIDE { return fBitmap.config(); }
#endif
virtual SkImageInfo imageInfo() const SK_OVERRIDE;

View File

@ -82,9 +82,11 @@ public:
*/
virtual bool isOpaque() const = 0;
#ifdef SK_SUPPORT_LEGACY_DEVICE_CONFIG
/** Return the bitmap config of the device's pixels
*/
virtual SkBitmap::Config config() const = 0;
#endif
/** Return the bitmap associated with this device. Call this each time you need
to access the bitmap, as it notifies the subclass to perform any flushing

View File

@ -82,7 +82,9 @@ public:
return NULL == fRenderTarget ? false
: kRGB_565_GrPixelConfig == fRenderTarget->config();
}
#ifdef SK_SUPPORT_LEGACY_DEVICE_CONFIG
virtual SkBitmap::Config config() const SK_OVERRIDE;
#endif
virtual void clear(SkColor color) SK_OVERRIDE;
virtual void drawPaint(const SkDraw&, const SkPaint& paint) SK_OVERRIDE;

View File

@ -51,9 +51,11 @@ public:
virtual int width() const SK_OVERRIDE { return fInfo.fSize.width(); }
virtual int height() const SK_OVERRIDE { return fInfo.fSize.height(); }
virtual bool isOpaque() const SK_OVERRIDE { return false; }
#ifdef SK_SUPPORT_LEGACY_DEVICE_CONFIG
virtual SkBitmap::Config config() const SK_OVERRIDE {
return SkBitmap::kNo_Config;
}
#endif
virtual SkImageInfo imageInfo() const SK_OVERRIDE {
return fEmptyBitmap.info();
}

View File

@ -380,6 +380,7 @@ SK_COMPILE_ASSERT(SkShader::kLast_BitmapType == 6, shader_type_mismatch);
///////////////////////////////////////////////////////////////////////////////
#ifdef SK_SUPPORT_LEGACY_DEVICE_CONFIG
SkBitmap::Config SkGpuDevice::config() const {
if (NULL == fRenderTarget) {
return SkBitmap::kNo_Config;
@ -388,6 +389,7 @@ SkBitmap::Config SkGpuDevice::config() const {
bool isOpaque;
return grConfig2skConfig(fRenderTarget->config(), &isOpaque);
}
#endif
void SkGpuDevice::clear(SkColor color) {
SkIRect rect = SkIRect::MakeWH(this->width(), this->height());

View File

@ -159,7 +159,9 @@ public:
virtual int width() const SK_OVERRIDE;
virtual int height() const SK_OVERRIDE;
#ifdef SK_SUPPORT_LEGACY_DEVICE_CONFIG
virtual SkBitmap::Config config() const SK_OVERRIDE;
#endif
virtual bool isOpaque() const SK_OVERRIDE;
virtual SkImageInfo imageInfo() const SK_OVERRIDE;
@ -435,9 +437,11 @@ int SkDeferredDevice::height() const {
return immediateDevice()->height();
}
#ifdef SK_SUPPORT_LEGACY_DEVICE_CONFIG
SkBitmap::Config SkDeferredDevice::config() const {
return immediateDevice()->config();
}
#endif
bool SkDeferredDevice::isOpaque() const {
return immediateDevice()->isOpaque();

View File

@ -38,9 +38,11 @@ public:
virtual int width() const SK_OVERRIDE { return fSize.width(); }
virtual int height() const SK_OVERRIDE { return fSize.height(); }
virtual bool isOpaque() const SK_OVERRIDE { return false; }
#ifdef SK_SUPPORT_LEGACY_DEVICE_CONFIG
virtual SkBitmap::Config config() const SK_OVERRIDE {
return SkBitmap::kNo_Config;
}
#endif
virtual SkImageInfo imageInfo() const SK_OVERRIDE {
return fEmptyBitmap.info();
}

View File

@ -61,9 +61,11 @@ public:
virtual int width() const SK_OVERRIDE { return fSize.width(); }
virtual int height() const SK_OVERRIDE { return fSize.height(); }
virtual bool isOpaque() const SK_OVERRIDE { return false; }
#ifdef SK_SUPPORT_LEGACY_DEVICE_CONFIG
virtual SkBitmap::Config config() const SK_OVERRIDE {
return SkBitmap::kNo_Config;
}
#endif
virtual GrRenderTarget* accessRenderTarget() SK_OVERRIDE { return NULL; }
virtual bool filterTextFlags(const SkPaint& paint, TextFlags*) SK_OVERRIDE {
return false;