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

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

Issue 2108503004: Dump batch bounds and scissor rect (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update to match B.'s formatting Created 4 years, 5 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/GrBatch.h ('k') | src/gpu/batches/GrCopySurfaceBatch.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 GrClearBatch_DEFINED 8 #ifndef GrClearBatch_DEFINED
9 #define GrClearBatch_DEFINED 9 #define GrClearBatch_DEFINED
10 10
(...skipping 18 matching lines...) Expand all
29 const char* name() const override { return "Clear"; } 29 const char* name() const override { return "Clear"; }
30 30
31 uint32_t renderTargetUniqueID() const override { return fRenderTarget.get()- >getUniqueID(); } 31 uint32_t renderTargetUniqueID() const override { return fRenderTarget.get()- >getUniqueID(); }
32 GrRenderTarget* renderTarget() const override { return fRenderTarget.get(); } 32 GrRenderTarget* renderTarget() const override { return fRenderTarget.get(); }
33 33
34 SkString dumpInfo() const override { 34 SkString dumpInfo() const override {
35 SkString string; 35 SkString string;
36 string.printf("Color: 0x%08x, Rect [L: %d, T: %d, R: %d, B: %d], RT: %d" , 36 string.printf("Color: 0x%08x, Rect [L: %d, T: %d, R: %d, B: %d], RT: %d" ,
37 fColor, fRect.fLeft, fRect.fTop, fRect.fRight, fRect.fBott om, 37 fColor, fRect.fLeft, fRect.fTop, fRect.fRight, fRect.fBott om,
38 fRenderTarget.get()->getUniqueID()); 38 fRenderTarget.get()->getUniqueID());
39 string.append(INHERITED::dumpInfo());
39 return string; 40 return string;
40 } 41 }
41 42
42 private: 43 private:
43 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override { 44 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override {
44 // This could be much more complicated. Currently we look at cases where the new clear 45 // This could be much more complicated. Currently we look at cases where the new clear
45 // contains the old clear, or when the new clear is a subset of the old clear and is the 46 // contains the old clear, or when the new clear is a subset of the old clear and is the
46 // same color. 47 // same color.
47 GrClearBatch* cb = t->cast<GrClearBatch>(); 48 GrClearBatch* cb = t->cast<GrClearBatch>();
48 SkASSERT(cb->fRenderTarget == fRenderTarget); 49 SkASSERT(cb->fRenderTarget == fRenderTarget);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 const char* name() const override { return "ClearStencilClip"; } 86 const char* name() const override { return "ClearStencilClip"; }
86 87
87 uint32_t renderTargetUniqueID() const override { return fRenderTarget.get()- >getUniqueID(); } 88 uint32_t renderTargetUniqueID() const override { return fRenderTarget.get()- >getUniqueID(); }
88 GrRenderTarget* renderTarget() const override { return fRenderTarget.get(); } 89 GrRenderTarget* renderTarget() const override { return fRenderTarget.get(); }
89 90
90 SkString dumpInfo() const override { 91 SkString dumpInfo() const override {
91 SkString string; 92 SkString string;
92 string.printf("Rect [L: %d, T: %d, R: %d, B: %d], IC: %d, RT: 0x%p", 93 string.printf("Rect [L: %d, T: %d, R: %d, B: %d], IC: %d, RT: 0x%p",
93 fRect.fLeft, fRect.fTop, fRect.fRight, fRect.fBottom, fIns ideClip, 94 fRect.fLeft, fRect.fTop, fRect.fRight, fRect.fBottom, fIns ideClip,
94 fRenderTarget.get()); 95 fRenderTarget.get());
96 string.append(INHERITED::dumpInfo());
95 return string; 97 return string;
96 } 98 }
97 99
98 private: 100 private:
99 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override { return f alse; } 101 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override { return f alse; }
100 102
101 void onPrepare(GrBatchFlushState*) override {} 103 void onPrepare(GrBatchFlushState*) override {}
102 104
103 void onDraw(GrBatchFlushState* state) override { 105 void onDraw(GrBatchFlushState* state) override {
104 state->commandBuffer()->clearStencilClip(fRect, fInsideClip, fRenderTarg et.get()); 106 state->commandBuffer()->clearStencilClip(fRect, fInsideClip, fRenderTarg et.get());
105 } 107 }
106 108
107 SkIRect fRect; 109 SkIRect fRect;
108 bool fInsideClip; 110 bool fInsideClip;
109 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget; 111 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget;
110 112
111 typedef GrBatch INHERITED; 113 typedef GrBatch INHERITED;
112 }; 114 };
113 115
114 #endif 116 #endif
OLDNEW
« no previous file with comments | « src/gpu/batches/GrBatch.h ('k') | src/gpu/batches/GrCopySurfaceBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698