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; | 10 // We will use the reordering buffer, unless we have NVPR. |
11 | 11 // TODO move NVPR to batch so we can reorder |
12 GrInOrderDrawBuffer::GrInOrderDrawBuffer(GrContext* context) | 12 GrInOrderDrawBuffer::GrInOrderDrawBuffer(GrContext* context) |
13 : INHERITED(context) | 13 : INHERITED(context) |
14 , fCommands(GrCommandBuilder::Create(context->getGpu(), kEnableReordering)) | 14 , fCommands(GrCommandBuilder::Create( |
bsalomon
2015/05/27 17:16:06
seems like a lot of logic in the init list.
stati
| |
15 context->getGpu(), | |
16 !context->getGpu()->caps()->shaderCaps()->pathRenderingSuppo rt())) | |
15 , fPathIndexBuffer(kPathIdxBufferMinReserve * sizeof(char)/4) | 17 , fPathIndexBuffer(kPathIdxBufferMinReserve * sizeof(char)/4) |
16 , fPathTransformBuffer(kPathXformBufferMinReserve * sizeof(float)/4) | 18 , fPathTransformBuffer(kPathXformBufferMinReserve * sizeof(float)/4) |
17 , fPipelineBuffer(kPipelineBufferMinReserve) | 19 , fPipelineBuffer(kPipelineBufferMinReserve) |
18 , fDrawID(0) { | 20 , fDrawID(0) { |
19 } | 21 } |
20 | 22 |
21 GrInOrderDrawBuffer::~GrInOrderDrawBuffer() { | 23 GrInOrderDrawBuffer::~GrInOrderDrawBuffer() { |
22 this->reset(); | 24 this->reset(); |
23 } | 25 } |
24 | 26 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
189 fPrevState->getPipeline()->isEqual(*state->getPipeline())) { | 191 fPrevState->getPipeline()->isEqual(*state->getPipeline())) { |
190 this->unallocState(state); | 192 this->unallocState(state); |
191 } else { | 193 } else { |
192 fPrevState.reset(state); | 194 fPrevState.reset(state); |
193 } | 195 } |
194 | 196 |
195 this->recordTraceMarkersIfNecessary( | 197 this->recordTraceMarkersIfNecessary( |
196 fCommands->recordXferBarrierIfNecessary(*fPrevState->getPipeline(), *this->caps())); | 198 fCommands->recordXferBarrierIfNecessary(*fPrevState->getPipeline(), *this->caps())); |
197 return fPrevState; | 199 return fPrevState; |
198 } | 200 } |
OLD | NEW |