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" |
| 11 #include "GrReorderCommandBuilder.h" |
| 12 |
| 13 GrCommandBuilder* GrCommandBuilder::Create(GrGpu* gpu, bool reorder) { |
| 14 if (reorder) { |
| 15 return SkNEW_ARGS(GrReorderCommandBuilder, (gpu)); |
| 16 } else { |
| 17 return SkNEW_ARGS(GrInOrderCommandBuilder, (gpu)); |
| 18 } |
| 19 } |
| 20 |
10 GrTargetCommands::Cmd* GrCommandBuilder::recordClear(const SkIRect* rect, | 21 GrTargetCommands::Cmd* GrCommandBuilder::recordClear(const SkIRect* rect, |
11 GrColor color, | 22 GrColor color, |
12 bool canIgnoreRect, | 23 bool canIgnoreRect, |
13 GrRenderTarget* renderTarge
t) { | 24 GrRenderTarget* renderTarge
t) { |
14 SkASSERT(renderTarget); | 25 SkASSERT(renderTarget); |
15 | 26 |
16 SkIRect r; | 27 SkIRect r; |
17 if (NULL == rect) { | 28 if (NULL == rect) { |
18 // 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 |
19 // 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 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 79 |
69 GrXferBarrierType barrierType; | 80 GrXferBarrierType barrierType; |
70 if (!xp.willNeedXferBarrier(rt, caps, &barrierType)) { | 81 if (!xp.willNeedXferBarrier(rt, caps, &barrierType)) { |
71 return NULL; | 82 return NULL; |
72 } | 83 } |
73 | 84 |
74 XferBarrier* xb = GrNEW_APPEND_TO_RECORDER(*this->cmdBuffer(), XferBarrier,
()); | 85 XferBarrier* xb = GrNEW_APPEND_TO_RECORDER(*this->cmdBuffer(), XferBarrier,
()); |
75 xb->fBarrierType = barrierType; | 86 xb->fBarrierType = barrierType; |
76 return xb; | 87 return xb; |
77 } | 88 } |
OLD | NEW |