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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 1107973004: Pull cache out of GrContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fixpicturerenderer.cpp Created 5 years, 8 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/GrTextureProvider.cpp ('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 3434671d6add50f4532dcf25ba4fe0545edc01b7..b9c7f12f29e7595b47ad9fbc6426e103f8b2b518 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -199,7 +199,8 @@ GrRenderTarget* SkGpuDevice::CreateRenderTarget(GrContext* context, SkSurface::B
desc.fHeight = info.height();
desc.fConfig = SkImageInfo2GrPixelConfig(info);
desc.fSampleCnt = sampleCount;
- GrTexture* texture = context->createTexture(desc, SkToBool(budgeted), NULL, 0);
+ GrTexture* texture = context->textureProvider()->createTexture(
+ desc, SkToBool(budgeted), NULL, 0);
if (NULL == texture) {
return NULL;
}
@@ -699,8 +700,8 @@ bool draw_with_mask_filter(GrContext* context,
desc.fHeight = dstM.fBounds.height();
desc.fConfig = kAlpha_8_GrPixelConfig;
- SkAutoTUnref<GrTexture> texture(
- context->refScratchTexture(desc, GrContext::kApprox_ScratchTexMatch));
+ SkAutoTUnref<GrTexture> texture(context->textureProvider()->refScratchTexture(
+ desc, GrTextureProvider::kApprox_ScratchTexMatch));
if (!texture) {
return false;
}
@@ -734,7 +735,8 @@ GrTexture* create_mask_GPU(GrContext* context,
desc.fConfig = kAlpha_8_GrPixelConfig;
}
- GrTexture* mask = context->refScratchTexture(desc,GrContext::kApprox_ScratchTexMatch);
+ GrTexture* mask = context->textureProvider()->refScratchTexture(
+ desc, GrTextureProvider::kApprox_ScratchTexMatch);
if (NULL == mask) {
return NULL;
}
@@ -1948,10 +1950,10 @@ SkBaseDevice* SkGpuDevice::onCreateDevice(const CreateInfo& cinfo, const SkPaint
// layers are never draw in repeat modes, so we can request an approx
// match and ignore any padding.
- const GrContext::ScratchTexMatch match = (kNever_TileUsage == cinfo.fTileUsage) ?
- GrContext::kApprox_ScratchTexMatch :
- GrContext::kExact_ScratchTexMatch;
- texture.reset(fContext->refScratchTexture(desc, match));
+ const GrTextureProvider::ScratchTexMatch match = (kNever_TileUsage == cinfo.fTileUsage) ?
+ GrTextureProvider::kApprox_ScratchTexMatch :
+ GrTextureProvider::kExact_ScratchTexMatch;
+ texture.reset(fContext->textureProvider()->refScratchTexture(desc, match));
if (texture) {
SkSurfaceProps props(fSurfaceProps.flags(), cinfo.fPixelGeometry);
« no previous file with comments | « src/gpu/GrTextureProvider.cpp ('k') | src/gpu/SkGr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698