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