aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar cblume <cblume@chromium.org>2016-08-30 12:09:23 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-30 12:09:23 -0700
commit33e0cb5e7f9926b96db209c825f1eeca7c15bb16 (patch)
tree223df9287fcea04f9e686aee68a63f58ba34f3f0 /include
parentfdf2986b1965dfc6a6067858e558914d6103d43a (diff)
Store mipmap levels in deferred texture image
This is a follow-up to https://codereview.chromium.org/2115023002/ and https://codereview.chromium.org/2034933003/ which were reverted due to an access violation and a memory leak, respectively. When creating the deferred texture image, detect if using medium / high quality. If so, generate and store mipmaps in the deferred texture image. When creating a texture from that be sure to read it back out. BUG=578304 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2242883004 Review-Url: https://codereview.chromium.org/2242883004
Diffstat (limited to 'include')
-rw-r--r--include/core/SkImage.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/core/SkImage.h b/include/core/SkImage.h
index bdcb5b0abe..f55b679c0b 100644
--- a/include/core/SkImage.h
+++ b/include/core/SkImage.h
@@ -365,8 +365,7 @@ public:
/** Drawing params for which a deferred texture image data should be optimized. */
struct DeferredTextureImageUsageParams {
- DeferredTextureImageUsageParams() : fPreScaleMipLevel(0) {}
- DeferredTextureImageUsageParams(const SkMatrix matrix, const SkFilterQuality quality,
+ DeferredTextureImageUsageParams(const SkMatrix matrix, const SkFilterQuality quality,
int preScaleMipLevel)
: fMatrix(matrix), fQuality(quality), fPreScaleMipLevel(preScaleMipLevel) {}
SkMatrix fMatrix;
@@ -397,7 +396,9 @@ public:
size_t getDeferredTextureImageData(const GrContextThreadSafeProxy&,
const DeferredTextureImageUsageParams[],
int paramCnt,
- void* buffer) const;
+ void* buffer,
+ SkSourceGammaTreatment treatment =
+ SkSourceGammaTreatment::kIgnore) const;
/**
* Returns a texture-backed image from data produced in SkImage::getDeferredTextureImageData.
@@ -470,7 +471,7 @@ protected:
private:
static sk_sp<SkImage> MakeTextureFromMipMap(GrContext*, const SkImageInfo&,
const GrMipLevel* texels, int mipLevelCount,
- SkBudgeted);
+ SkBudgeted, SkSourceGammaTreatment);
const int fWidth;
const int fHeight;