Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(296)

Unified Diff: src/image/SkImage_Gpu.cpp

Issue 1734043002: Revert of Move Budgeted enum out of SkSurface, use in GrTextureProvider (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/image/SkImage_Gpu.h ('k') | src/image/SkSurface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « src/image/SkImage_Gpu.h ('k') | src/image/SkSurface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698