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 15 matching lines...) Expand all Loading... |
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 | 35 |
36 SkASSERT(color == GrColor_ILLEGAL || | 36 SkASSERT(canIgnoreRect || (rect->fLeft <= rect->fRight && rect->fTop <= rect
->fBottom)); |
37 canIgnoreRect || | |
38 (rect->fLeft <= rect->fRight && rect->fTop <= rect->fBottom)); | |
39 | 37 |
40 Clear* clr = GrNEW_APPEND_TO_RECORDER(*this->cmdBuffer(), Clear, (renderTarg
et)); | 38 Clear* clr = GrNEW_APPEND_TO_RECORDER(*this->cmdBuffer(), Clear, (renderTarg
et)); |
41 GrColorIsPMAssert(color); | 39 GrColorIsPMAssert(color); |
42 clr->fColor = color; | 40 clr->fColor = color; |
43 clr->fRect = *rect; | 41 clr->fRect = *rect; |
44 clr->fCanIgnoreRect = canIgnoreRect; | 42 clr->fCanIgnoreRect = canIgnoreRect; |
45 return clr; | 43 return clr; |
46 } | 44 } |
47 | 45 |
48 GrTargetCommands::Cmd* GrCommandBuilder::recordClearStencilClip(const SkIRect& r
ect, | 46 GrTargetCommands::Cmd* GrCommandBuilder::recordClearStencilClip(const SkIRect& r
ect, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 82 |
85 GrXferBarrierType barrierType; | 83 GrXferBarrierType barrierType; |
86 if (!xp.willNeedXferBarrier(rt, caps, &barrierType)) { | 84 if (!xp.willNeedXferBarrier(rt, caps, &barrierType)) { |
87 return NULL; | 85 return NULL; |
88 } | 86 } |
89 | 87 |
90 XferBarrier* xb = GrNEW_APPEND_TO_RECORDER(*this->cmdBuffer(), XferBarrier,
(rt)); | 88 XferBarrier* xb = GrNEW_APPEND_TO_RECORDER(*this->cmdBuffer(), XferBarrier,
(rt)); |
91 xb->fBarrierType = barrierType; | 89 xb->fBarrierType = barrierType; |
92 return xb; | 90 return xb; |
93 } | 91 } |
OLD | NEW |