aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkSpecialImage.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-02-29 11:41:52 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-29 11:41:52 -0800
commit84a4e5a8d683bf17d6c3058b977b9dfb000428af (patch)
tree2d1a39c9baee537c1457f03ea1c51d5a911c2432 /src/core/SkSpecialImage.cpp
parent3a9be690772f0417df2abe318c71e9b2fec0f8c5 (diff)
Remove internal calls to SkImage::getTexture
Diffstat (limited to 'src/core/SkSpecialImage.cpp')
-rw-r--r--src/core/SkSpecialImage.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/core/SkSpecialImage.cpp b/src/core/SkSpecialImage.cpp
index 50117b2e83..88d90b8602 100644
--- a/src/core/SkSpecialImage.cpp
+++ b/src/core/SkSpecialImage.cpp
@@ -6,6 +6,7 @@
*/
#include "SkCanvas.h"
+#include "SkImage_Base.h"
#include "SkSpecialImage.h"
#include "SkSpecialSurface.h"
@@ -33,24 +34,24 @@ private:
};
///////////////////////////////////////////////////////////////////////////////
-static inline const SkSpecialImage_Base* as_IB(const SkSpecialImage* image) {
+static inline const SkSpecialImage_Base* as_SIB(const SkSpecialImage* image) {
return static_cast<const SkSpecialImage_Base*>(image);
}
void SkSpecialImage::draw(SkCanvas* canvas, SkScalar x, SkScalar y, const SkPaint* paint) const {
- return as_IB(this)->onDraw(canvas, x, y, paint);
+ return as_SIB(this)->onDraw(canvas, x, y, paint);
}
bool SkSpecialImage::peekPixels(SkPixmap* pixmap) const {
- return as_IB(this)->onPeekPixels(pixmap);
+ return as_SIB(this)->onPeekPixels(pixmap);
}
GrTexture* SkSpecialImage::peekTexture() const {
- return as_IB(this)->onPeekTexture();
+ return as_SIB(this)->onPeekTexture();
}
SkSpecialSurface* SkSpecialImage::newSurface(const SkImageInfo& info) const {
- return as_IB(this)->onNewSurface(info);
+ return as_SIB(this)->onNewSurface(info);
}
#if SK_SUPPORT_GPU
@@ -72,7 +73,7 @@ SkSpecialImage* SkSpecialImage::internal_fromBM(SkImageFilter::Proxy* proxy,
}
bool SkSpecialImage::internal_getBM(SkBitmap* result) {
- const SkSpecialImage_Base* ib = as_IB(this);
+ const SkSpecialImage_Base* ib = as_SIB(this);
// TODO: need to test offset case! (see skbug.com/4967)
return ib->getBitmap(result);
@@ -102,8 +103,8 @@ public:
size_t getSize() const override {
#if SK_SUPPORT_GPU
- if (fImage->getTexture()) {
- return fImage->getTexture()->gpuMemorySize();
+ if (GrTexture* texture = as_IB(fImage.get())->peekTexture()) {
+ return texture->gpuMemorySize();
} else
#endif
{
@@ -128,7 +129,7 @@ public:
return fImage->peekPixels(pixmap);
}
- GrTexture* onPeekTexture() const override { return fImage->getTexture(); }
+ GrTexture* onPeekTexture() const override { return as_IB(fImage.get())->peekTexture(); }
bool getBitmap(SkBitmap* result) const override {
return false;
@@ -136,7 +137,7 @@ public:
SkSpecialSurface* onNewSurface(const SkImageInfo& info) const override {
#if SK_SUPPORT_GPU
- GrTexture* texture = fImage->getTexture();
+ GrTexture* texture = as_IB(fImage.get())->peekTexture();
if (texture) {
GrSurfaceDesc desc = GrImageInfoToSurfaceDesc(info);
desc.fFlags = kRenderTarget_GrSurfaceFlag;