OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "GrInOrderDrawBuffer.h" | 8 #include "GrInOrderDrawBuffer.h" |
9 | 9 |
| 10 static const bool kEnableReordering = true; |
| 11 |
10 GrInOrderDrawBuffer::GrInOrderDrawBuffer(GrContext* context) | 12 GrInOrderDrawBuffer::GrInOrderDrawBuffer(GrContext* context) |
11 : INHERITED(context) | 13 : INHERITED(context) |
12 , fCommands(GrCommandBuilder::Create(context->getGpu(), false)) | 14 , fCommands(GrCommandBuilder::Create(context->getGpu(), kEnableReordering)) |
13 , fPathIndexBuffer(kPathIdxBufferMinReserve * sizeof(char)/4) | 15 , fPathIndexBuffer(kPathIdxBufferMinReserve * sizeof(char)/4) |
14 , fPathTransformBuffer(kPathXformBufferMinReserve * sizeof(float)/4) | 16 , fPathTransformBuffer(kPathXformBufferMinReserve * sizeof(float)/4) |
15 , fPipelineBuffer(kPipelineBufferMinReserve) | 17 , fPipelineBuffer(kPipelineBufferMinReserve) |
16 , fDrawID(0) { | 18 , fDrawID(0) { |
17 } | 19 } |
18 | 20 |
19 GrInOrderDrawBuffer::~GrInOrderDrawBuffer() { | 21 GrInOrderDrawBuffer::~GrInOrderDrawBuffer() { |
20 this->reset(); | 22 this->reset(); |
21 } | 23 } |
22 | 24 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 fPrevState->getPipeline()->isEqual(*state->getPipeline())) { | 189 fPrevState->getPipeline()->isEqual(*state->getPipeline())) { |
188 this->unallocState(state); | 190 this->unallocState(state); |
189 } else { | 191 } else { |
190 fPrevState.reset(state); | 192 fPrevState.reset(state); |
191 } | 193 } |
192 | 194 |
193 this->recordTraceMarkersIfNecessary( | 195 this->recordTraceMarkersIfNecessary( |
194 fCommands->recordXferBarrierIfNecessary(*fPrevState->getPipeline(),
*this->caps())); | 196 fCommands->recordXferBarrierIfNecessary(*fPrevState->getPipeline(),
*this->caps())); |
195 return fPrevState; | 197 return fPrevState; |
196 } | 198 } |
OLD | NEW |