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

Side by Side Diff: src/image/SkSurface_Gpu.cpp

Issue 1187523005: Add support for creating texture backed images where Skia will delete the texture. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add default param to support Chrome's current callers Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « src/image/SkImage_Gpu.cpp ('k') | tests/GrPorterDuffTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkSurface_Gpu.h" 8 #include "SkSurface_Gpu.h"
9 9
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 } 102 }
103 103
104 SkSurface* SkSurface::NewWrappedRenderTarget(GrContext* context, GrBackendTextur eDesc desc, 104 SkSurface* SkSurface::NewWrappedRenderTarget(GrContext* context, GrBackendTextur eDesc desc,
105 const SkSurfaceProps* props) { 105 const SkSurfaceProps* props) {
106 if (NULL == context) { 106 if (NULL == context) {
107 return NULL; 107 return NULL;
108 } 108 }
109 if (!SkToBool(desc.fFlags & kRenderTarget_GrBackendTextureFlag)) { 109 if (!SkToBool(desc.fFlags & kRenderTarget_GrBackendTextureFlag)) {
110 return NULL; 110 return NULL;
111 } 111 }
112 SkAutoTUnref<GrSurface> surface(context->textureProvider()->wrapBackendTextu re(desc)); 112 SkAutoTUnref<GrSurface> surface(context->textureProvider()->wrapBackendTextu re(desc,
113 kBorrow_GrWrapOwnership));
113 if (!surface) { 114 if (!surface) {
114 return NULL; 115 return NULL;
115 } 116 }
116 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(surface->asRenderTarget (), props)); 117 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(surface->asRenderTarget (), props));
117 if (!device) { 118 if (!device) {
118 return NULL; 119 return NULL;
119 } 120 }
120 return SkNEW_ARGS(SkSurface_Gpu, (device)); 121 return SkNEW_ARGS(SkSurface_Gpu, (device));
121 } 122 }
122 123
123 #endif 124 #endif
OLDNEW
« no previous file with comments | « src/image/SkImage_Gpu.cpp ('k') | tests/GrPorterDuffTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698