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

Side by Side Diff: src/gpu/batches/GrBatch.h

Issue 1494473005: Add option to draw wireframe batch bounds (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: init vbo id to 0 Created 5 years 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/GrTest.cpp ('k') | src/gpu/batches/GrClearBatch.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 2015 Google Inc. 2 * Copyright 2015 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 #ifndef GrBatch_DEFINED 8 #ifndef GrBatch_DEFINED
9 #define GrBatch_DEFINED 9 #define GrBatch_DEFINED
10 10
11 #include <new> 11 #include <new>
12 #include "GrNonAtomicRef.h" 12 #include "GrNonAtomicRef.h"
13 13
14 #include "SkRect.h" 14 #include "SkRect.h"
15 #include "SkString.h" 15 #include "SkString.h"
16 16
17 class GrCaps; 17 class GrCaps;
18 class GrBatchFlushState; 18 class GrBatchFlushState;
19 class GrRenderTarget;
19 20
20 /** 21 /**
21 * GrBatch is the base class for all Ganesh deferred geometry generators. To fa cilitate 22 * GrBatch is the base class for all Ganesh deferred geometry generators. To fa cilitate
22 * reorderable batching, Ganesh does not generate geometry inline with draw call s. Instead, it 23 * reorderable batching, Ganesh does not generate geometry inline with draw call s. Instead, it
23 * captures the arguments to the draw and then generates the geometry on demand. This gives GrBatch 24 * captures the arguments to the draw and then generates the geometry on demand. This gives GrBatch
24 * subclasses complete freedom to decide how / what they can batch. 25 * subclasses complete freedom to decide how / what they can batch.
25 * 26 *
26 * Batches are created when GrContext processes a draw call. Batches of the same subclass may be 27 * Batches are created when GrContext processes a draw call. Batches of the same subclass may be
27 * merged using combineIfPossible. When two batches merge, one takes on the unio n of the data 28 * merged using combineIfPossible. When two batches merge, one takes on the unio n of the data
28 * and the other is left empty. The merged batch becomes responsible for drawing the data from both 29 * and the other is left empty. The merged batch becomes responsible for drawing the data from both
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 /** Issues the batches commands to GrGpu. */ 107 /** Issues the batches commands to GrGpu. */
107 void draw(GrBatchFlushState* state) { this->onDraw(state); } 108 void draw(GrBatchFlushState* state) { this->onDraw(state); }
108 109
109 /** Used to block batching across render target changes. Remove this once we store 110 /** Used to block batching across render target changes. Remove this once we store
110 GrBatches for different RTs in different targets. */ 111 GrBatches for different RTs in different targets. */
111 virtual uint32_t renderTargetUniqueID() const = 0; 112 virtual uint32_t renderTargetUniqueID() const = 0;
112 113
113 /** Used for spewing information about batches when debugging. */ 114 /** Used for spewing information about batches when debugging. */
114 virtual SkString dumpInfo() const = 0; 115 virtual SkString dumpInfo() const = 0;
115 116
117 /** Can remove this when multi-draw-buffer lands */
118 virtual GrRenderTarget* renderTarget() const = 0;
119
116 protected: 120 protected:
117 // NOTE, compute some bounds, even if extremely conservative. Do *NOT* setL argest on the bounds 121 // NOTE, compute some bounds, even if extremely conservative. Do *NOT* setL argest on the bounds
118 // rect because we outset it for dst copy textures 122 // rect because we outset it for dst copy textures
119 void setBounds(const SkRect& newBounds) { fBounds = newBounds; } 123 void setBounds(const SkRect& newBounds) { fBounds = newBounds; }
120 124
121 void joinBounds(const SkRect& otherBounds) { 125 void joinBounds(const SkRect& otherBounds) {
122 return fBounds.joinPossiblyEmptyRect(otherBounds); 126 return fBounds.joinPossiblyEmptyRect(otherBounds);
123 } 127 }
124 128
125 static uint32_t GenBatchClassID() { return GenID(&gCurrBatchClassID); } 129 static uint32_t GenBatchClassID() { return GenID(&gCurrBatchClassID); }
(...skipping 26 matching lines...) Expand all
152 #if GR_BATCH_SPEW 156 #if GR_BATCH_SPEW
153 static uint32_t GenBatchID() { return GenID(&gCurrBatchUniqueID); } 157 static uint32_t GenBatchID() { return GenID(&gCurrBatchUniqueID); }
154 const uint32_t fUniqueID; 158 const uint32_t fUniqueID;
155 static int32_t gCurrBatchUniqueID; 159 static int32_t gCurrBatchUniqueID;
156 #endif 160 #endif
157 static int32_t gCurrBatchClassID; 161 static int32_t gCurrBatchClassID;
158 typedef GrNonAtomicRef INHERITED; 162 typedef GrNonAtomicRef INHERITED;
159 }; 163 };
160 164
161 #endif 165 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrTest.cpp ('k') | src/gpu/batches/GrClearBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698