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

Side by Side Diff: src/gpu/GrGpu.cpp

Issue 1139753002: Refactor GrBufferAllocPools to use resource cache (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix merge issue 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/gpu/GrCaps.cpp ('k') | src/gpu/GrIndexBuffer.h » ('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 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "GrGpu.h" 10 #include "GrGpu.h"
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 } 192 }
193 193
194 GrRenderTarget* GrGpu::wrapBackendRenderTarget(const GrBackendRenderTargetDesc& desc, 194 GrRenderTarget* GrGpu::wrapBackendRenderTarget(const GrBackendRenderTargetDesc& desc,
195 GrWrapOwnership ownership) { 195 GrWrapOwnership ownership) {
196 this->handleDirtyContext(); 196 this->handleDirtyContext();
197 return this->onWrapBackendRenderTarget(desc, ownership); 197 return this->onWrapBackendRenderTarget(desc, ownership);
198 } 198 }
199 199
200 GrVertexBuffer* GrGpu::createVertexBuffer(size_t size, bool dynamic) { 200 GrVertexBuffer* GrGpu::createVertexBuffer(size_t size, bool dynamic) {
201 this->handleDirtyContext(); 201 this->handleDirtyContext();
202 return this->onCreateVertexBuffer(size, dynamic); 202 GrVertexBuffer* vb = this->onCreateVertexBuffer(size, dynamic);
203 if (!this->caps()->reuseScratchBuffers()) {
204 vb->resourcePriv().removeScratchKey();
205 }
206 return vb;
203 } 207 }
204 208
205 GrIndexBuffer* GrGpu::createIndexBuffer(size_t size, bool dynamic) { 209 GrIndexBuffer* GrGpu::createIndexBuffer(size_t size, bool dynamic) {
206 this->handleDirtyContext(); 210 this->handleDirtyContext();
207 return this->onCreateIndexBuffer(size, dynamic); 211 GrIndexBuffer* ib = this->onCreateIndexBuffer(size, dynamic);
212 if (!this->caps()->reuseScratchBuffers()) {
213 ib->resourcePriv().removeScratchKey();
214 }
215 return ib;
208 } 216 }
209 217
210 void GrGpu::clear(const SkIRect* rect, 218 void GrGpu::clear(const SkIRect* rect,
211 GrColor color, 219 GrColor color,
212 bool canIgnoreRect, 220 bool canIgnoreRect,
213 GrRenderTarget* renderTarget) { 221 GrRenderTarget* renderTarget) {
214 SkASSERT(renderTarget); 222 SkASSERT(renderTarget);
215 this->handleDirtyContext(); 223 this->handleDirtyContext();
216 this->onClear(renderTarget, rect, color, canIgnoreRect); 224 this->onClear(renderTarget, rect, color, canIgnoreRect);
217 } 225 }
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 //////////////////////////////////////////////////////////////////////////////// 304 ////////////////////////////////////////////////////////////////////////////////
297 305
298 void GrGpu::draw(const DrawArgs& args, const GrVertices& vertices) { 306 void GrGpu::draw(const DrawArgs& args, const GrVertices& vertices) {
299 this->handleDirtyContext(); 307 this->handleDirtyContext();
300 GrVertices::Iterator iter; 308 GrVertices::Iterator iter;
301 const GrNonInstancedVertices* verts = iter.init(vertices); 309 const GrNonInstancedVertices* verts = iter.init(vertices);
302 do { 310 do {
303 this->onDraw(args, *verts); 311 this->onDraw(args, *verts);
304 } while ((verts = iter.next())); 312 } while ((verts = iter.next()));
305 } 313 }
OLDNEW
« no previous file with comments | « src/gpu/GrCaps.cpp ('k') | src/gpu/GrIndexBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698