OLD | NEW |
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 |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 SkString dumpInfo() const override { | 32 SkString dumpInfo() const override { |
33 SkString string; | 33 SkString string; |
34 string.printf("RT: %d", fRenderTarget.get()->getUniqueID()); | 34 string.printf("RT: %d", fRenderTarget.get()->getUniqueID()); |
35 string.append(INHERITED::dumpInfo()); | 35 string.append(INHERITED::dumpInfo()); |
36 return string; | 36 return string; |
37 } | 37 } |
38 | 38 |
39 private: | 39 private: |
40 bool onCombineIfPossible(GrBatch* that, const GrCaps& caps) override { | 40 bool onCombineIfPossible(GrBatch* that, const GrCaps& caps) override { |
41 return fRenderTarget == that->cast<GrDiscardBatch>()->fRenderTarget; | 41 return this->renderTargetUniqueID() == that->renderTargetUniqueID(); |
42 } | 42 } |
43 | 43 |
44 void onPrepare(GrBatchFlushState*) override {} | 44 void onPrepare(GrBatchFlushState*) override {} |
45 | 45 |
46 void onDraw(GrBatchFlushState* state) override { | 46 void onDraw(GrBatchFlushState* state) override { |
47 state->commandBuffer()->discard(fRenderTarget.get()); | 47 state->commandBuffer()->discard(fRenderTarget.get()); |
48 } | 48 } |
49 | 49 |
50 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget; | 50 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget; |
51 | 51 |
52 typedef GrBatch INHERITED; | 52 typedef GrBatch INHERITED; |
53 }; | 53 }; |
54 | 54 |
55 #endif | 55 #endif |
OLD | NEW |