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

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

Issue 1286043004: Make GrVertexBatch objects hold their own draws during GrDrawTarget flush (Closed) Base URL: https://skia.googlesource.com/skia.git@m
Patch Set: forward decl Created 5 years, 4 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/GrBatchTarget.cpp ('k') | src/gpu/GrCommandBuilder.h » ('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 "GrBufferedDrawTarget.h" 8 #include "GrBufferedDrawTarget.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.
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 // Note, fPrevState points into fPipelineBuffer's allocation, so we have to reset first. 96 // Note, fPrevState points into fPipelineBuffer's allocation, so we have to reset first.
97 // Furthermore, we have to reset fCommands before fPipelineBuffer too. 97 // Furthermore, we have to reset fCommands before fPipelineBuffer too.
98 if (fDrawID % kPipelineBufferHighWaterMark) { 98 if (fDrawID % kPipelineBufferHighWaterMark) {
99 fPipelineBuffer.rewind(); 99 fPipelineBuffer.rewind();
100 } else { 100 } else {
101 fPipelineBuffer.reset(); 101 fPipelineBuffer.reset();
102 } 102 }
103 } 103 }
104 104
105 void GrBufferedDrawTarget::onFlush() { 105 void GrBufferedDrawTarget::onFlush() {
106 fCommands->flush(this); 106 fCommands->flush(this->getGpu(), this->getContext()->resourceProvider());
107 ++fDrawID; 107 ++fDrawID;
108 } 108 }
109 109
110 void GrBufferedDrawTarget::onCopySurface(GrSurface* dst, 110 void GrBufferedDrawTarget::onCopySurface(GrSurface* dst,
111 GrSurface* src, 111 GrSurface* src,
112 const SkIRect& srcRect, 112 const SkIRect& srcRect,
113 const SkIPoint& dstPoint) { 113 const SkIPoint& dstPoint) {
114 fCommands->recordCopySurface(dst, src, srcRect, dstPoint); 114 fCommands->recordCopySurface(dst, src, srcRect, dstPoint);
115 } 115 }
116 116
(...skipping 14 matching lines...) Expand all
131 *state->fPrimitiveProcesso r, 131 *state->fPrimitiveProcesso r,
132 state->fBatchTracker) && 132 state->fBatchTracker) &&
133 GrPipeline::AreEqual(*fPrevState->getPipeline(), *state->getPipeline(), false)) { 133 GrPipeline::AreEqual(*fPrevState->getPipeline(), *state->getPipeline(), false)) {
134 this->unallocState(state); 134 this->unallocState(state);
135 } else { 135 } else {
136 fPrevState.reset(state); 136 fPrevState.reset(state);
137 } 137 }
138 138
139 return fPrevState; 139 return fPrevState;
140 } 140 }
OLDNEW
« no previous file with comments | « src/gpu/GrBatchTarget.cpp ('k') | src/gpu/GrCommandBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698