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

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

Issue 2215323003: Start using RenderTargetProxy (omnibus) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 4 years, 1 month 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/gpu/effects/GrTextureDomain.cpp ('k') | tests/ClearTest.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 "GrContextPriv.h" 10 #include "GrContextPriv.h"
(...skipping 23 matching lines...) Expand all
34 case SkSurface::kFlushWrite_BackendHandleAccess: 34 case SkSurface::kFlushWrite_BackendHandleAccess:
35 case SkSurface::kDiscardWrite_BackendHandleAccess: 35 case SkSurface::kDiscardWrite_BackendHandleAccess:
36 // for now we don't special-case on Discard, but we may in the futur e. 36 // for now we don't special-case on Discard, but we may in the futur e.
37 surface->notifyContentWillChange(SkSurface::kRetain_ContentChangeMod e); 37 surface->notifyContentWillChange(SkSurface::kRetain_ContentChangeMod e);
38 break; 38 break;
39 } 39 }
40 40
41 // Grab the render target *after* firing notifications, as it may get switch ed if CoW kicks in. 41 // Grab the render target *after* firing notifications, as it may get switch ed if CoW kicks in.
42 surface->getDevice()->flush(); 42 surface->getDevice()->flush();
43 GrRenderTargetContext* rtc = surface->getDevice()->accessRenderTargetContext (); 43 GrRenderTargetContext* rtc = surface->getDevice()->accessRenderTargetContext ();
44 return rtc->accessRenderTarget(); 44 return rtc->instantiate();
45 } 45 }
46 46
47 GrBackendObject SkSurface_Gpu::onGetTextureHandle(BackendHandleAccess access) { 47 GrBackendObject SkSurface_Gpu::onGetTextureHandle(BackendHandleAccess access) {
48 GrRenderTarget* rt = prepare_rt_for_external_access(this, access); 48 GrRenderTarget* rt = prepare_rt_for_external_access(this, access);
49 GrTexture* texture = rt->asTexture(); 49 GrTexture* texture = rt->asTexture();
50 if (texture) { 50 if (texture) {
51 return texture->getTextureHandle(); 51 return texture->getTextureHandle();
52 } 52 }
53 return 0; 53 return 0;
54 } 54 }
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 259
260 sk_sp<SkGpuDevice> device(SkGpuDevice::Make(std::move(rtc), desc.fWidth, des c.fHeight, 260 sk_sp<SkGpuDevice> device(SkGpuDevice::Make(std::move(rtc), desc.fWidth, des c.fHeight,
261 SkGpuDevice::kUninit_InitContent s)); 261 SkGpuDevice::kUninit_InitContent s));
262 if (!device) { 262 if (!device) {
263 return nullptr; 263 return nullptr;
264 } 264 }
265 return sk_make_sp<SkSurface_Gpu>(std::move(device)); 265 return sk_make_sp<SkSurface_Gpu>(std::move(device));
266 } 266 }
267 267
268 #endif 268 #endif
OLDNEW
« no previous file with comments | « src/gpu/effects/GrTextureDomain.cpp ('k') | tests/ClearTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698