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 // We will use the reordering buffer, unless we have NVPR. | 10 // We will use the reordering buffer, unless we have NVPR. |
11 // TODO move NVPR to batch so we can reorder | 11 // TODO move NVPR to batch so we can reorder |
12 static inline bool allow_reordering(const GrCaps* caps) { | 12 static inline bool allow_reordering(const GrCaps* caps) { |
13 //return !caps->shaderCaps()->pathRenderingSupport(); | 13 return !caps->shaderCaps()->pathRenderingSupport(); |
14 return false; | |
15 } | 14 } |
16 | 15 |
17 GrInOrderDrawBuffer::GrInOrderDrawBuffer(GrContext* context) | 16 GrInOrderDrawBuffer::GrInOrderDrawBuffer(GrContext* context) |
18 : INHERITED(context) | 17 : INHERITED(context) |
19 , fCommands(GrCommandBuilder::Create(context->getGpu(), allow_reordering(con
text->caps()))) | 18 , fCommands(GrCommandBuilder::Create(context->getGpu(), allow_reordering(con
text->caps()))) |
20 , fPathIndexBuffer(kPathIdxBufferMinReserve * sizeof(char)/4) | 19 , fPathIndexBuffer(kPathIdxBufferMinReserve * sizeof(char)/4) |
21 , fPathTransformBuffer(kPathXformBufferMinReserve * sizeof(float)/4) | 20 , fPathTransformBuffer(kPathXformBufferMinReserve * sizeof(float)/4) |
22 , fPipelineBuffer(kPipelineBufferMinReserve) | 21 , fPipelineBuffer(kPipelineBufferMinReserve) |
23 , fDrawID(0) { | 22 , fDrawID(0) { |
24 } | 23 } |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 fPrevState->getPipeline()->isEqual(*state->getPipeline())) { | 192 fPrevState->getPipeline()->isEqual(*state->getPipeline())) { |
194 this->unallocState(state); | 193 this->unallocState(state); |
195 } else { | 194 } else { |
196 fPrevState.reset(state); | 195 fPrevState.reset(state); |
197 } | 196 } |
198 | 197 |
199 this->recordTraceMarkersIfNecessary( | 198 this->recordTraceMarkersIfNecessary( |
200 fCommands->recordXferBarrierIfNecessary(*fPrevState->getPipeline(),
*this->caps())); | 199 fCommands->recordXferBarrierIfNecessary(*fPrevState->getPipeline(),
*this->caps())); |
201 return fPrevState; | 200 return fPrevState; |
202 } | 201 } |
OLD | NEW |