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

Side by Side Diff: src/gpu/batches/GrDiscardBatch.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/GrCopySurfaceBatch.h ('k') | src/gpu/batches/GrDrawBatch.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 GrDiscardBatch_DEFINED 8 #ifndef GrDiscardBatch_DEFINED
9 #define GrDiscardBatch_DEFINED 9 #define GrDiscardBatch_DEFINED
10 10
11 #include "GrBatch.h" 11 #include "GrBatch.h"
12 #include "GrBatchFlushState.h" 12 #include "GrBatchFlushState.h"
13 #include "GrGpu.h" 13 #include "GrGpu.h"
14 #include "GrRenderTarget.h" 14 #include "GrRenderTarget.h"
15 15
16 class GrDiscardBatch final : public GrBatch { 16 class GrDiscardBatch final : public GrBatch {
17 public: 17 public:
18 DEFINE_BATCH_CLASS_ID 18 DEFINE_BATCH_CLASS_ID
19 19
20 GrDiscardBatch(GrRenderTarget* rt) 20 GrDiscardBatch(GrRenderTarget* rt)
21 : INHERITED(ClassID()) 21 : INHERITED(ClassID())
22 , fRenderTarget(rt) { 22 , fRenderTarget(rt) {
23 fBounds = SkRect::MakeWH(SkIntToScalar(rt->width()), SkIntToScalar(rt->h eight())); 23 fBounds = SkRect::MakeWH(SkIntToScalar(rt->width()), SkIntToScalar(rt->h eight()));
24 } 24 }
25 25
26 const char* name() const override { return "Discard"; } 26 const char* name() const override { return "Discard"; }
27 27
28 uint32_t renderTargetUniqueID() const override { return fRenderTarget.get()- >getUniqueID(); } 28 uint32_t renderTargetUniqueID() const override { return fRenderTarget.get()- >getUniqueID(); }
29 29
30 GrRenderTarget* rt2() const override { return fRenderTarget.get(); }
31
30 SkString dumpInfo() const override { 32 SkString dumpInfo() const override {
31 SkString string; 33 SkString string;
32 string.printf("RT: 0x%p", fRenderTarget.get()); 34 string.printf("RT: 0x%p", fRenderTarget.get());
33 return string; 35 return string;
34 } 36 }
35 37
36 private: 38 private:
37 bool onCombineIfPossible(GrBatch* that, const GrCaps& caps) override { 39 bool onCombineIfPossible(GrBatch* that, const GrCaps& caps) override {
38 return fRenderTarget == that->cast<GrDiscardBatch>()->fRenderTarget; 40 return fRenderTarget == that->cast<GrDiscardBatch>()->fRenderTarget;
39 } 41 }
40 42
41 void onPrepare(GrBatchFlushState*) override {} 43 void onPrepare(GrBatchFlushState*) override {}
42 44
43 void onDraw(GrBatchFlushState* state) override { 45 void onDraw(GrBatchFlushState* state) override {
44 state->gpu()->discard(fRenderTarget.get()); 46 state->gpu()->discard(fRenderTarget.get());
45 } 47 }
46 48
47 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget; 49 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget;
48 50
49 typedef GrBatch INHERITED; 51 typedef GrBatch INHERITED;
50 }; 52 };
51 53
52 #endif 54 #endif
OLDNEW
« no previous file with comments | « src/gpu/batches/GrCopySurfaceBatch.h ('k') | src/gpu/batches/GrDrawBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698