OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GrCommandBuilder.h" | 8 #include "GrCommandBuilder.h" |
9 | 9 |
10 #include "GrInOrderCommandBuilder.h" | 10 #include "GrInOrderCommandBuilder.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 SkASSERT(renderTarget); | 25 SkASSERT(renderTarget); |
26 | 26 |
27 SkIRect r; | 27 SkIRect r; |
28 if (NULL == rect) { | 28 if (NULL == rect) { |
29 // We could do something smart and remove previous draws and clears to | 29 // We could do something smart and remove previous draws and clears to |
30 // the current render target. If we get that smart we have to make sure | 30 // the current render target. If we get that smart we have to make sure |
31 // those draws aren't read before this clear (render-to-texture). | 31 // those draws aren't read before this clear (render-to-texture). |
32 r.setLTRB(0, 0, renderTarget->width(), renderTarget->height()); | 32 r.setLTRB(0, 0, renderTarget->width(), renderTarget->height()); |
33 rect = &r; | 33 rect = &r; |
34 } | 34 } |
| 35 |
| 36 SkASSERT(color == GrColor_ILLEGAL || |
| 37 canIgnoreRect || |
| 38 (rect->fLeft <= rect->fRight && rect->fTop <= rect->fBottom)); |
| 39 |
35 Clear* clr = GrNEW_APPEND_TO_RECORDER(*this->cmdBuffer(), Clear, (renderTarg
et)); | 40 Clear* clr = GrNEW_APPEND_TO_RECORDER(*this->cmdBuffer(), Clear, (renderTarg
et)); |
36 GrColorIsPMAssert(color); | 41 GrColorIsPMAssert(color); |
37 clr->fColor = color; | 42 clr->fColor = color; |
38 clr->fRect = *rect; | 43 clr->fRect = *rect; |
39 clr->fCanIgnoreRect = canIgnoreRect; | 44 clr->fCanIgnoreRect = canIgnoreRect; |
40 return clr; | 45 return clr; |
41 } | 46 } |
42 | 47 |
43 GrTargetCommands::Cmd* GrCommandBuilder::recordClearStencilClip(const SkIRect& r
ect, | 48 GrTargetCommands::Cmd* GrCommandBuilder::recordClearStencilClip(const SkIRect& r
ect, |
44 bool insideClip, | 49 bool insideClip, |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 84 |
80 GrXferBarrierType barrierType; | 85 GrXferBarrierType barrierType; |
81 if (!xp.willNeedXferBarrier(rt, caps, &barrierType)) { | 86 if (!xp.willNeedXferBarrier(rt, caps, &barrierType)) { |
82 return NULL; | 87 return NULL; |
83 } | 88 } |
84 | 89 |
85 XferBarrier* xb = GrNEW_APPEND_TO_RECORDER(*this->cmdBuffer(), XferBarrier,
(rt)); | 90 XferBarrier* xb = GrNEW_APPEND_TO_RECORDER(*this->cmdBuffer(), XferBarrier,
(rt)); |
86 xb->fBarrierType = barrierType; | 91 xb->fBarrierType = barrierType; |
87 return xb; | 92 return xb; |
88 } | 93 } |
OLD | NEW |