OLD | NEW |
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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 SkASSERT(image); | 99 SkASSERT(image); |
100 if (rt->asTexture() == as_IB(image)->getTexture()) { | 100 if (rt->asTexture() == as_IB(image)->getTexture()) { |
101 this->fDevice->replaceRenderTarget(SkSurface::kRetain_ContentChangeMode
== mode); | 101 this->fDevice->replaceRenderTarget(SkSurface::kRetain_ContentChangeMode
== mode); |
102 SkTextureImageApplyBudgetedDecision(image); | 102 SkTextureImageApplyBudgetedDecision(image); |
103 } else if (kDiscard_ContentChangeMode == mode) { | 103 } else if (kDiscard_ContentChangeMode == mode) { |
104 this->SkSurface_Gpu::onDiscard(); | 104 this->SkSurface_Gpu::onDiscard(); |
105 } | 105 } |
106 } | 106 } |
107 | 107 |
108 void SkSurface_Gpu::onDiscard() { | 108 void SkSurface_Gpu::onDiscard() { |
109 fDevice->accessRenderTarget()->discard(); | 109 fDevice->discard37(); |
110 } | 110 } |
111 | 111 |
112 /////////////////////////////////////////////////////////////////////////////// | 112 /////////////////////////////////////////////////////////////////////////////// |
113 | 113 |
114 SkSurface* SkSurface::NewRenderTargetDirect(GrRenderTarget* target, const SkSurf
aceProps* props) { | 114 SkSurface* SkSurface::NewRenderTargetDirect(GrRenderTarget* target, const SkSurf
aceProps* props) { |
115 SkAutoTUnref<SkGpuDevice> device( | 115 SkAutoTUnref<SkGpuDevice> device( |
116 SkGpuDevice::Create(target, props, SkGpuDevice::kUninit_InitContents)); | 116 SkGpuDevice::Create(target, props, SkGpuDevice::kUninit_InitContents)); |
117 if (!device) { | 117 if (!device) { |
118 return nullptr; | 118 return nullptr; |
119 } | 119 } |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 } | 163 } |
164 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(rt, props, | 164 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(rt, props, |
165 SkGpuDevice::kUninit_In
itContents)); | 165 SkGpuDevice::kUninit_In
itContents)); |
166 if (!device) { | 166 if (!device) { |
167 return nullptr; | 167 return nullptr; |
168 } | 168 } |
169 return new SkSurface_Gpu(device); | 169 return new SkSurface_Gpu(device); |
170 } | 170 } |
171 | 171 |
172 #endif | 172 #endif |
OLD | NEW |