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

Unified Diff: src/image/SkImage_Gpu.cpp

Issue 1728093005: Move Budgeted enum out of SkSurface, use in GrTextureProvider (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add aliases for Chrome 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 c502fc0092536ddbb971b40a76cf1aa33d6980cb..e28a31d4bf7792c457f92aa5e75f42475dcc3456 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,
- SkSurface::Budgeted budgeted)
+ SkBudgeted budgeted)
: INHERITED(w, h, uniqueID)
, fTexture(SkRef(tex))
, fAlphaType(at)
@@ -140,8 +140,7 @@ SkImage* SkImage_Gpu::onNewSubset(const SkIRect& subset) const {
desc.fWidth = subset.width();
desc.fHeight = subset.height();
- GrTexture* subTx = ctx->textureProvider()->createTexture(desc,
- SkSurface::kYes_Budgeted == fBudgeted);
+ GrTexture* subTx = ctx->textureProvider()->createTexture(desc, fBudgeted);
if (!subTx) {
return nullptr;
}
@@ -167,7 +166,7 @@ static SkImage* new_wrapped_texture_common(GrContext* ctx, const GrBackendTextur
tex->setRelease(releaseProc, releaseCtx);
}
- const SkSurface::Budgeted budgeted = SkSurface::kNo_Budgeted;
+ const SkBudgeted budgeted = SkBudgeted::kNo;
return new SkImage_Gpu(desc.fWidth, desc.fHeight, kNeedNewImageUniqueID, at, tex, budgeted);
}
@@ -193,22 +192,20 @@ SkImage* SkImage::NewFromTextureCopy(GrContext* ctx, const GrBackendTextureDesc&
return nullptr;
}
- const bool isBudgeted = true;
- SkAutoTUnref<GrTexture> dst(GrDeepCopyTexture(src, isBudgeted));
+ SkAutoTUnref<GrTexture> dst(GrDeepCopyTexture(src, SkBudgeted::kYes));
if (!dst) {
return nullptr;
}
- const SkSurface::Budgeted budgeted = SkSurface::kYes_Budgeted;
return new SkImage_Gpu(desc.fWidth, desc.fHeight, kNeedNewImageUniqueID, at, dst,
- budgeted);
+ SkBudgeted::kYes);
}
SkImage* SkImage::NewFromYUVTexturesCopy(GrContext* ctx , SkYUVColorSpace colorSpace,
const GrBackendObject yuvTextureHandles[3],
const SkISize yuvSizes[3],
GrSurfaceOrigin origin) {
- const SkSurface::Budgeted budgeted = SkSurface::kYes_Budgeted;
+ const SkBudgeted budgeted = SkBudgeted::kYes;
if (yuvSizes[0].fWidth <= 0 || yuvSizes[0].fHeight <= 0 ||
yuvSizes[1].fWidth <= 0 || yuvSizes[1].fHeight <= 0 ||
@@ -259,7 +256,7 @@ SkImage* SkImage::NewFromYUVTexturesCopy(GrContext* ctx , SkYUVColorSpace colorS
dstDesc.fConfig = kRGBA_8888_GrPixelConfig;
dstDesc.fSampleCnt = 0;
- SkAutoTUnref<GrTexture> dst(ctx->textureProvider()->createTexture(dstDesc, true));
+ SkAutoTUnref<GrTexture> dst(ctx->textureProvider()->createTexture(dstDesc, SkBudgeted::kYes));
if (!dst) {
return nullptr;
}
@@ -288,7 +285,7 @@ static SkImage* create_image_from_maker(GrTextureMaker* maker, SkAlphaType at, u
return nullptr;
}
return new SkImage_Gpu(texture->width(), texture->height(), id, at, texture,
- SkSurface::kNo_Budgeted);
+ SkBudgeted::kNo);
}
SkImage* SkImage::newTextureImage(GrContext *context) const {
@@ -315,7 +312,7 @@ SkImage* SkImage::newTextureImage(GrContext *context) const {
///////////////////////////////////////////////////////////////////////////////////////////////////
-GrTexture* GrDeepCopyTexture(GrTexture* src, bool budgeted) {
+GrTexture* GrDeepCopyTexture(GrTexture* src, SkBudgeted 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