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

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

Issue 1275543005: Move some work from backend onClear to base class clear (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Pass references and rebase Created 5 years, 4 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/GrGpu.h ('k') | src/gpu/GrImmediateDrawTarget.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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 209
210 GrIndexBuffer* GrGpu::createIndexBuffer(size_t size, bool dynamic) { 210 GrIndexBuffer* GrGpu::createIndexBuffer(size_t size, bool dynamic) {
211 this->handleDirtyContext(); 211 this->handleDirtyContext();
212 GrIndexBuffer* ib = this->onCreateIndexBuffer(size, dynamic); 212 GrIndexBuffer* ib = this->onCreateIndexBuffer(size, dynamic);
213 if (!this->caps()->reuseScratchBuffers()) { 213 if (!this->caps()->reuseScratchBuffers()) {
214 ib->resourcePriv().removeScratchKey(); 214 ib->resourcePriv().removeScratchKey();
215 } 215 }
216 return ib; 216 return ib;
217 } 217 }
218 218
219 void GrGpu::clear(const SkIRect* rect, 219 void GrGpu::clear(const SkIRect& rect,
220 GrColor color, 220 GrColor color,
221 bool canIgnoreRect,
222 GrRenderTarget* renderTarget) { 221 GrRenderTarget* renderTarget) {
223 SkASSERT(renderTarget); 222 SkASSERT(renderTarget);
223 SkASSERT(SkIRect::MakeWH(renderTarget->width(), renderTarget->height()).cont ains(rect));
224 this->handleDirtyContext(); 224 this->handleDirtyContext();
225 this->onClear(renderTarget, rect, color, canIgnoreRect); 225 this->onClear(renderTarget, rect, color);
226 } 226 }
227 227
228 void GrGpu::clearStencilClip(const SkIRect& rect, 228 void GrGpu::clearStencilClip(const SkIRect& rect,
229 bool insideClip, 229 bool insideClip,
230 GrRenderTarget* renderTarget) { 230 GrRenderTarget* renderTarget) {
231 SkASSERT(renderTarget); 231 SkASSERT(renderTarget);
232 this->handleDirtyContext(); 232 this->handleDirtyContext();
233 this->onClearStencilClip(renderTarget, rect, insideClip); 233 this->onClearStencilClip(renderTarget, rect, insideClip);
234 } 234 }
235 235
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 //////////////////////////////////////////////////////////////////////////////// 380 ////////////////////////////////////////////////////////////////////////////////
381 381
382 void GrGpu::draw(const DrawArgs& args, const GrVertices& vertices) { 382 void GrGpu::draw(const DrawArgs& args, const GrVertices& vertices) {
383 this->handleDirtyContext(); 383 this->handleDirtyContext();
384 GrVertices::Iterator iter; 384 GrVertices::Iterator iter;
385 const GrNonInstancedVertices* verts = iter.init(vertices); 385 const GrNonInstancedVertices* verts = iter.init(vertices);
386 do { 386 do {
387 this->onDraw(args, *verts); 387 this->onDraw(args, *verts);
388 } while ((verts = iter.next())); 388 } while ((verts = iter.next()));
389 } 389 }
OLDNEW
« no previous file with comments | « src/gpu/GrGpu.h ('k') | src/gpu/GrImmediateDrawTarget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698