Index: src/image/SkImage_Gpu.cpp |
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp |
index e28a31d4bf7792c457f92aa5e75f42475dcc3456..c502fc0092536ddbb971b40a76cf1aa33d6980cb 100644 |
--- a/src/image/SkImage_Gpu.cpp |
+++ b/src/image/SkImage_Gpu.cpp |
@@ -20,7 +20,7 @@ |
#include "SkPixelRef.h" |
SkImage_Gpu::SkImage_Gpu(int w, int h, uint32_t uniqueID, SkAlphaType at, GrTexture* tex, |
- SkBudgeted budgeted) |
+ SkSurface::Budgeted budgeted) |
: INHERITED(w, h, uniqueID) |
, fTexture(SkRef(tex)) |
, fAlphaType(at) |
@@ -140,7 +140,8 @@ |
desc.fWidth = subset.width(); |
desc.fHeight = subset.height(); |
- GrTexture* subTx = ctx->textureProvider()->createTexture(desc, fBudgeted); |
+ GrTexture* subTx = ctx->textureProvider()->createTexture(desc, |
+ SkSurface::kYes_Budgeted == fBudgeted); |
if (!subTx) { |
return nullptr; |
} |
@@ -166,7 +167,7 @@ |
tex->setRelease(releaseProc, releaseCtx); |
} |
- const SkBudgeted budgeted = SkBudgeted::kNo; |
+ const SkSurface::Budgeted budgeted = SkSurface::kNo_Budgeted; |
return new SkImage_Gpu(desc.fWidth, desc.fHeight, kNeedNewImageUniqueID, at, tex, budgeted); |
} |
@@ -192,20 +193,22 @@ |
return nullptr; |
} |
- SkAutoTUnref<GrTexture> dst(GrDeepCopyTexture(src, SkBudgeted::kYes)); |
+ const bool isBudgeted = true; |
+ SkAutoTUnref<GrTexture> dst(GrDeepCopyTexture(src, isBudgeted)); |
if (!dst) { |
return nullptr; |
} |
+ const SkSurface::Budgeted budgeted = SkSurface::kYes_Budgeted; |
return new SkImage_Gpu(desc.fWidth, desc.fHeight, kNeedNewImageUniqueID, at, dst, |
- SkBudgeted::kYes); |
+ budgeted); |
} |
SkImage* SkImage::NewFromYUVTexturesCopy(GrContext* ctx , SkYUVColorSpace colorSpace, |
const GrBackendObject yuvTextureHandles[3], |
const SkISize yuvSizes[3], |
GrSurfaceOrigin origin) { |
- const SkBudgeted budgeted = SkBudgeted::kYes; |
+ const SkSurface::Budgeted budgeted = SkSurface::kYes_Budgeted; |
if (yuvSizes[0].fWidth <= 0 || yuvSizes[0].fHeight <= 0 || |
yuvSizes[1].fWidth <= 0 || yuvSizes[1].fHeight <= 0 || |
@@ -256,7 +259,7 @@ |
dstDesc.fConfig = kRGBA_8888_GrPixelConfig; |
dstDesc.fSampleCnt = 0; |
- SkAutoTUnref<GrTexture> dst(ctx->textureProvider()->createTexture(dstDesc, SkBudgeted::kYes)); |
+ SkAutoTUnref<GrTexture> dst(ctx->textureProvider()->createTexture(dstDesc, true)); |
if (!dst) { |
return nullptr; |
} |
@@ -285,7 +288,7 @@ |
return nullptr; |
} |
return new SkImage_Gpu(texture->width(), texture->height(), id, at, texture, |
- SkBudgeted::kNo); |
+ SkSurface::kNo_Budgeted); |
} |
SkImage* SkImage::newTextureImage(GrContext *context) const { |
@@ -312,7 +315,7 @@ |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
-GrTexture* GrDeepCopyTexture(GrTexture* src, SkBudgeted budgeted) { |
+GrTexture* GrDeepCopyTexture(GrTexture* src, bool budgeted) { |
GrContext* ctx = src->getContext(); |
GrSurfaceDesc desc = src->desc(); |