aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPictureImageGenerator.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-03-03 11:10:18 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-03 17:40:52 +0000
commit4447b64a88ea141161fca772c2fec28b6141bbc3 (patch)
treefce75d30623892dfe7271acdd671623240302e10 /src/core/SkPictureImageGenerator.cpp
parent3c6d5b0daa8c9ff1137bb2ef9b00a712bb3a47c2 (diff)
Switch SkImageGenerator over to generating GrTextureProxies
It does not seem irrational for generateTexture to always receive a valid GrContext. lockAsBitmap can do as it pleases. This is split out of: https://skia-review.googlesource.com/c/8823/ (Remove GrFragmentProcessor-derived class' GrTexture-based ctors) Change-Id: I8aebc813a8a3a7d694b7369c2c9810e2164fe16e Reviewed-on: https://skia-review.googlesource.com/9191 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/core/SkPictureImageGenerator.cpp')
-rw-r--r--src/core/SkPictureImageGenerator.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core/SkPictureImageGenerator.cpp b/src/core/SkPictureImageGenerator.cpp
index 44a6b82895..a1d919af34 100644
--- a/src/core/SkPictureImageGenerator.cpp
+++ b/src/core/SkPictureImageGenerator.cpp
@@ -94,10 +94,11 @@ SkImageGenerator::MakeFromPicture(const SkISize& size, sk_sp<SkPicture> picture,
///////////////////////////////////////////////////////////////////////////////////////////////////
#if SK_SUPPORT_GPU
-#include "GrTexture.h"
+sk_sp<GrTextureProxy> SkPictureImageGenerator::onGenerateTexture(GrContext* ctx,
+ const SkImageInfo& info,
+ const SkIPoint& origin) {
+ SkASSERT(ctx);
-GrTexture* SkPictureImageGenerator::onGenerateTexture(GrContext* ctx, const SkImageInfo& info,
- const SkIPoint& origin) {
//
// TODO: respect the usage, by possibly creating a different (pow2) surface
//
@@ -114,6 +115,6 @@ GrTexture* SkPictureImageGenerator::onGenerateTexture(GrContext* ctx, const SkIm
if (!image) {
return nullptr;
}
- return SkSafeRef(as_IB(image)->peekTexture());
+ return as_IB(image)->asTextureProxyRef();
}
#endif