Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: src/gpu/GrInOrderDrawBuffer.cpp

Issue 1149773005: Add direct getter for GrCaps to GrContext. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: init caps in the right place Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/GrPathRendererChain.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 GrGpu* gpu) { 12 static inline bool allow_reordering(const GrCaps* caps) {
13 //const GrCaps* caps = gpu->caps(); 13 //return !caps->shaderCaps()->pathRenderingSupport();
14 //return caps && caps->shaderCaps() && !caps->shaderCaps()->pathRenderingSup port();
15 return false; 14 return false;
16 } 15 }
17 16
18 GrInOrderDrawBuffer::GrInOrderDrawBuffer(GrContext* context) 17 GrInOrderDrawBuffer::GrInOrderDrawBuffer(GrContext* context)
19 : INHERITED(context) 18 : INHERITED(context)
20 , fCommands(GrCommandBuilder::Create(context->getGpu(), allow_reordering(con text->getGpu()))) 19 , fCommands(GrCommandBuilder::Create(context->getGpu(), allow_reordering(con text->caps())))
21 , fPathIndexBuffer(kPathIdxBufferMinReserve * sizeof(char)/4) 20 , fPathIndexBuffer(kPathIdxBufferMinReserve * sizeof(char)/4)
22 , fPathTransformBuffer(kPathXformBufferMinReserve * sizeof(float)/4) 21 , fPathTransformBuffer(kPathXformBufferMinReserve * sizeof(float)/4)
23 , fPipelineBuffer(kPipelineBufferMinReserve) 22 , fPipelineBuffer(kPipelineBufferMinReserve)
24 , fDrawID(0) { 23 , fDrawID(0) {
25 } 24 }
26 25
27 GrInOrderDrawBuffer::~GrInOrderDrawBuffer() { 26 GrInOrderDrawBuffer::~GrInOrderDrawBuffer() {
28 this->reset(); 27 this->reset();
29 } 28 }
30 29
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 fPrevState->getPipeline()->isEqual(*state->getPipeline())) { 194 fPrevState->getPipeline()->isEqual(*state->getPipeline())) {
196 this->unallocState(state); 195 this->unallocState(state);
197 } else { 196 } else {
198 fPrevState.reset(state); 197 fPrevState.reset(state);
199 } 198 }
200 199
201 this->recordTraceMarkersIfNecessary( 200 this->recordTraceMarkersIfNecessary(
202 fCommands->recordXferBarrierIfNecessary(*fPrevState->getPipeline(), *this->caps())); 201 fCommands->recordXferBarrierIfNecessary(*fPrevState->getPipeline(), *this->caps()));
203 return fPrevState; 202 return fPrevState;
204 } 203 }
OLDNEW
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/GrPathRendererChain.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698