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

Unified Diff: src/gpu/SkGpuDevice.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/gpu/SkGpuDevice.h ('k') | src/gpu/SkGr.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index cf613a9cac55b6026c5cf83bbd5b5be38c218203..0b44a4281ae0522c634e4b3a9427eb2206dbcdda 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -147,7 +147,7 @@
return new SkGpuDevice(rt, width, height, props, flags);
}
-SkGpuDevice* SkGpuDevice::Create(GrContext* context, SkBudgeted budgeted,
+SkGpuDevice* SkGpuDevice::Create(GrContext* context, SkSurface::Budgeted budgeted,
const SkImageInfo& info, int sampleCount,
const SkSurfaceProps* props, InitContents init,
GrTextureStorageAllocator customAllocator) {
@@ -185,7 +185,7 @@
}
GrRenderTarget* SkGpuDevice::CreateRenderTarget(
- GrContext* context, SkBudgeted budgeted, const SkImageInfo& origInfo,
+ GrContext* context, SkSurface::Budgeted budgeted, const SkImageInfo& origInfo,
int sampleCount, GrTextureStorageAllocator textureStorageAllocator) {
if (kUnknown_SkColorType == origInfo.colorType() ||
origInfo.width() < 0 || origInfo.height() < 0) {
@@ -216,7 +216,8 @@
desc.fConfig = SkImageInfo2GrPixelConfig(info);
desc.fSampleCnt = sampleCount;
desc.fTextureStorageAllocator = textureStorageAllocator;
- GrTexture* texture = context->textureProvider()->createTexture(desc, budgeted, nullptr, 0);
+ GrTexture* texture = context->textureProvider()->createTexture(
+ desc, SkToBool(budgeted), nullptr, 0);
if (nullptr == texture) {
return nullptr;
}
@@ -320,7 +321,9 @@
void SkGpuDevice::replaceRenderTarget(bool shouldRetainContent) {
ASSERT_SINGLE_OWNER
- SkBudgeted budgeted = fRenderTarget->resourcePriv().isBudgeted();
+ SkSurface::Budgeted budgeted =
+ fRenderTarget->resourcePriv().isBudgeted() ? SkSurface::kYes_Budgeted
+ : SkSurface::kNo_Budgeted;
SkAutoTUnref<GrRenderTarget> newRT(CreateRenderTarget(
this->context(), budgeted, this->imageInfo(), fRenderTarget->desc().fSampleCnt,
@@ -1781,7 +1784,7 @@
if (kNever_TileUsage == cinfo.fTileUsage) {
texture.reset(fContext->textureProvider()->createApproxTexture(desc));
} else {
- texture.reset(fContext->textureProvider()->createTexture(desc, SkBudgeted::kYes));
+ texture.reset(fContext->textureProvider()->createTexture(desc, true));
}
if (texture) {
@@ -1799,7 +1802,7 @@
SkSurface* SkGpuDevice::newSurface(const SkImageInfo& info, const SkSurfaceProps& props) {
ASSERT_SINGLE_OWNER
// TODO: Change the signature of newSurface to take a budgeted parameter.
- static const SkBudgeted kBudgeted = SkBudgeted::kNo;
+ static const SkSurface::Budgeted kBudgeted = SkSurface::kNo_Budgeted;
return SkSurface::NewRenderTarget(fContext, kBudgeted, info, fRenderTarget->desc().fSampleCnt,
&props);
}
« no previous file with comments | « src/gpu/SkGpuDevice.h ('k') | src/gpu/SkGr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698