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

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

Issue 1225923010: Refugee from Dead Machine 4: MDB Monster Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Last update from dead machine Created 4 years, 7 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/batches/GrAADistanceFieldPathRenderer.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
(...skipping 30 matching lines...) Expand all
41 #define GrBATCH_INFO(...) 41 #define GrBATCH_INFO(...)
42 #endif 42 #endif
43 43
44 // A helper macro to generate a class static id 44 // A helper macro to generate a class static id
45 #define DEFINE_BATCH_CLASS_ID \ 45 #define DEFINE_BATCH_CLASS_ID \
46 static uint32_t ClassID() { \ 46 static uint32_t ClassID() { \
47 static uint32_t kClassID = GenBatchClassID(); \ 47 static uint32_t kClassID = GenBatchClassID(); \
48 return kClassID; \ 48 return kClassID; \
49 } 49 }
50 50
51 class GrRenderTarget;
52
51 class GrBatch : public GrNonAtomicRef { 53 class GrBatch : public GrNonAtomicRef {
52 public: 54 public:
53 GrBatch(uint32_t classID); 55 GrBatch(uint32_t classID);
54 ~GrBatch() override; 56 ~GrBatch() override;
55 57
56 virtual const char* name() const = 0; 58 virtual const char* name() const = 0;
57 59
58 bool combineIfPossible(GrBatch* that, const GrCaps& caps) { 60 bool combineIfPossible(GrBatch* that, const GrCaps& caps) {
59 if (this->classID() != that->classID()) { 61 if (this->classID() != that->classID()) {
60 return false; 62 return false;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 to quickly issue its draw when draw is called. */ 101 to quickly issue its draw when draw is called. */
100 void prepare(GrBatchFlushState* state) { this->onPrepare(state); } 102 void prepare(GrBatchFlushState* state) { this->onPrepare(state); }
101 103
102 /** Issues the batches commands to GrGpu. */ 104 /** Issues the batches commands to GrGpu. */
103 void draw(GrBatchFlushState* state) { this->onDraw(state); } 105 void draw(GrBatchFlushState* state) { this->onDraw(state); }
104 106
105 /** Used to block batching across render target changes. Remove this once we store 107 /** Used to block batching across render target changes. Remove this once we store
106 GrBatches for different RTs in different targets. */ 108 GrBatches for different RTs in different targets. */
107 virtual uint32_t renderTargetUniqueID() const = 0; 109 virtual uint32_t renderTargetUniqueID() const = 0;
108 110
111 virtual GrRenderTarget* rt2() const = 0;
112
109 /** Used for spewing information about batches when debugging. */ 113 /** Used for spewing information about batches when debugging. */
110 virtual SkString dumpInfo() const = 0; 114 virtual SkString dumpInfo() const = 0;
111 115
112 protected: 116 protected:
113 // NOTE, compute some bounds, even if extremely conservative. Do *NOT* setL argest on the bounds 117 // NOTE, compute some bounds, even if extremely conservative. Do *NOT* setL argest on the bounds
114 // rect because we outset it for dst copy textures 118 // rect because we outset it for dst copy textures
115 void setBounds(const SkRect& newBounds) { fBounds = newBounds; } 119 void setBounds(const SkRect& newBounds) { fBounds = newBounds; }
116 120
117 void joinBounds(const SkRect& otherBounds) { 121 void joinBounds(const SkRect& otherBounds) {
118 return fBounds.joinPossiblyEmptyRect(otherBounds); 122 return fBounds.joinPossiblyEmptyRect(otherBounds);
(...skipping 29 matching lines...) Expand all
148 #if GR_BATCH_SPEW 152 #if GR_BATCH_SPEW
149 static uint32_t GenBatchID() { return GenID(&gCurrBatchUniqueID); } 153 static uint32_t GenBatchID() { return GenID(&gCurrBatchUniqueID); }
150 const uint32_t fUniqueID; 154 const uint32_t fUniqueID;
151 static int32_t gCurrBatchUniqueID; 155 static int32_t gCurrBatchUniqueID;
152 #endif 156 #endif
153 static int32_t gCurrBatchClassID; 157 static int32_t gCurrBatchClassID;
154 typedef GrNonAtomicRef INHERITED; 158 typedef GrNonAtomicRef INHERITED;
155 }; 159 };
156 160
157 #endif 161 #endif
OLDNEW
« no previous file with comments | « src/gpu/batches/GrAADistanceFieldPathRenderer.cpp ('k') | src/gpu/batches/GrClearBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698