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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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, | 221 bool canIgnoreRect, |
222 GrRenderTarget* renderTarget) { | 222 GrRenderTarget* renderTarget) { |
223 SkASSERT(renderTarget); | 223 SkASSERT(renderTarget); |
224 this->handleDirtyContext(); | 224 this->handleDirtyContext(); |
225 this->onClear(renderTarget, rect, color, canIgnoreRect); | 225 |
226 if (canIgnoreRect && this->caps()->fullClearIsFree()) { | |
227 rect = NULL; | |
228 } | |
229 | |
230 SkIRect clippedRect; | |
231 if (rect) { | |
232 // flushScissor expects rect to be clipped to the target. | |
233 clippedRect = *rect; | |
234 SkIRect rtRect = SkIRect::MakeWH(renderTarget->width(), renderTarget->he ight()); | |
235 if (clippedRect.intersect(rtRect)) { | |
egdaniel
2015/08/05 19:59:05
I wonder if its worth also checking if the clipped
bsalomon
2015/08/05 20:18:57
Should this all be done even higher up (e.g. GrDT)
| |
236 rect = &clippedRect; | |
237 } else { | |
238 return; | |
239 } | |
240 } | |
241 | |
242 this->onClear(renderTarget, rect, color); | |
226 } | 243 } |
227 | 244 |
228 void GrGpu::clearStencilClip(const SkIRect& rect, | 245 void GrGpu::clearStencilClip(const SkIRect& rect, |
229 bool insideClip, | 246 bool insideClip, |
230 GrRenderTarget* renderTarget) { | 247 GrRenderTarget* renderTarget) { |
231 SkASSERT(renderTarget); | 248 SkASSERT(renderTarget); |
232 this->handleDirtyContext(); | 249 this->handleDirtyContext(); |
233 this->onClearStencilClip(renderTarget, rect, insideClip); | 250 this->onClearStencilClip(renderTarget, rect, insideClip); |
234 } | 251 } |
235 | 252 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
380 //////////////////////////////////////////////////////////////////////////////// | 397 //////////////////////////////////////////////////////////////////////////////// |
381 | 398 |
382 void GrGpu::draw(const DrawArgs& args, const GrVertices& vertices) { | 399 void GrGpu::draw(const DrawArgs& args, const GrVertices& vertices) { |
383 this->handleDirtyContext(); | 400 this->handleDirtyContext(); |
384 GrVertices::Iterator iter; | 401 GrVertices::Iterator iter; |
385 const GrNonInstancedVertices* verts = iter.init(vertices); | 402 const GrNonInstancedVertices* verts = iter.init(vertices); |
386 do { | 403 do { |
387 this->onDraw(args, *verts); | 404 this->onDraw(args, *verts); |
388 } while ((verts = iter.next())); | 405 } while ((verts = iter.next())); |
389 } | 406 } |
OLD | NEW |