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

Unified Diff: tools/PictureRenderer.cpp

Issue 13947016: Simplify bench pictures render target creation. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/PictureRenderer.cpp
===================================================================
--- tools/PictureRenderer.cpp (revision 8573)
+++ tools/PictureRenderer.cpp (working copy)
@@ -112,8 +112,7 @@
// fall through
#endif
case kGPU_DeviceType: {
- SkAutoTUnref<GrRenderTarget> rt;
- bool grSuccess = false;
+ SkAutoTUnref<GrSurface> target;
if (fGrContext) {
// create a render target to back the device
GrTextureDesc desc;
@@ -122,20 +121,14 @@
desc.fWidth = width;
desc.fHeight = height;
desc.fSampleCnt = 0;
- GrTexture* tex = fGrContext->createUncachedTexture(desc, NULL, 0);
- if (tex) {
- rt.reset(tex->asRenderTarget());
- rt.get()->ref();
- tex->unref();
- grSuccess = NULL != rt.get();
- }
+ target.reset(fGrContext->createUncachedTexture(desc, NULL, 0));
}
- if (!grSuccess) {
+ if (NULL == target.get()) {
SkASSERT(0);
return NULL;
}
- SkAutoTUnref<SkGpuDevice> device(SkNEW_ARGS(SkGpuDevice, (fGrContext, rt)));
+ SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(target));
canvas = SkNEW_ARGS(SkCanvas, (device.get()));
break;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698