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 GrDrawBatch_DEFINED | 8 #ifndef GrDrawBatch_DEFINED |
9 #define GrDrawBatch_DEFINED | 9 #define GrDrawBatch_DEFINED |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 const GrPipeline* pipeline() const { | 49 const GrPipeline* pipeline() const { |
50 SkASSERT(fPipelineInstalled); | 50 SkASSERT(fPipelineInstalled); |
51 return reinterpret_cast<const GrPipeline*>(fPipelineStorage.get()); | 51 return reinterpret_cast<const GrPipeline*>(fPipelineStorage.get()); |
52 } | 52 } |
53 | 53 |
54 bool installPipeline(const GrPipeline::CreateArgs&); | 54 bool installPipeline(const GrPipeline::CreateArgs&); |
55 | 55 |
56 // TODO no GrPrimitiveProcessors yet read fragment position | 56 // TODO no GrPrimitiveProcessors yet read fragment position |
57 bool willReadFragmentPosition() const { return false; } | 57 bool willReadFragmentPosition() const { return false; } |
58 | 58 |
| 59 uint32_t renderTargetUniqueID() const final { |
| 60 SkASSERT(fPipelineInstalled); |
| 61 return this->pipeline()->getRenderTarget()->getUniqueID(); |
| 62 } |
| 63 |
| 64 SkString dumpInfo() const override { |
| 65 SkString string; |
| 66 string.append("ColorStages:\n"); |
| 67 for (int i = 0; i < this->pipeline()->numColorFragmentStages(); i++) { |
| 68 string.appendf("\t\t%s\n", this->pipeline()->getColorStage(i).proces
sor()->name()); |
| 69 } |
| 70 string.append("CoverageStages:\n"); |
| 71 for (int i = 0; i < this->pipeline()->numCoverageFragmentStages(); i++)
{ |
| 72 string.appendf("\t%s\n", this->pipeline()->getCoverageStage(i).proce
ssor()->name()); |
| 73 } |
| 74 string.appendf("XP: %s\n", this->pipeline()->getXferProcessor()->name())
; |
| 75 return string; |
| 76 } |
| 77 |
59 private: | 78 private: |
60 /** | 79 /** |
61 * initBatchTracker is a hook for the some additional overrides / optimizati
on possibilities | 80 * initBatchTracker is a hook for the some additional overrides / optimizati
on possibilities |
62 * from the GrXferProcessor. | 81 * from the GrXferProcessor. |
63 */ | 82 */ |
64 virtual void initBatchTracker(const GrPipelineOptimizations&) = 0; | 83 virtual void initBatchTracker(const GrPipelineOptimizations&) = 0; |
65 | 84 |
66 protected: | 85 protected: |
67 SkTArray<SkAutoTUnref<GrBatchUploader>, true> fInlineUploads; | 86 SkTArray<SkAutoTUnref<GrBatchUploader>, true> fInlineUploads; |
68 | 87 |
69 private: | 88 private: |
70 SkAlignedSTStorage<1, GrPipeline> fPipelineStorage; | 89 SkAlignedSTStorage<1, GrPipeline> fPipelineStorage; |
71 bool fPipelineInstalled; | 90 bool fPipelineInstalled; |
72 typedef GrBatch INHERITED; | 91 typedef GrBatch INHERITED; |
73 }; | 92 }; |
74 | 93 |
75 #endif | 94 #endif |
OLD | NEW |