OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |