OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2015 Google Inc. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
| 7 |
| 8 #ifndef GrDrawBatch_DEFINED |
| 9 #define GrDrawBatch_DEFINED |
| 10 |
| 11 #include "GrBatch.h" |
| 12 #include "GrPipeline.h" |
| 13 |
| 14 struct GrInitInvariantOutput; |
| 15 |
| 16 /** |
| 17 * Base class for GrBatches that draw. These batches have a GrPipeline installed
by GrDrawTarget. |
| 18 */ |
| 19 class GrDrawBatch : public GrBatch { |
| 20 public: |
| 21 GrDrawBatch(); |
| 22 ~GrDrawBatch() override; |
| 23 |
| 24 virtual void getInvariantOutputColor(GrInitInvariantOutput* out) const = 0; |
| 25 virtual void getInvariantOutputCoverage(GrInitInvariantOutput* out) const =
0; |
| 26 |
| 27 const GrPipeline* pipeline() const { |
| 28 SkASSERT(fPipelineInstalled); |
| 29 return reinterpret_cast<const GrPipeline*>(fPipelineStorage.get()); |
| 30 } |
| 31 |
| 32 bool installPipeline(const GrPipeline::CreateArgs&); |
| 33 |
| 34 // TODO no GrPrimitiveProcessors yet read fragment position |
| 35 bool willReadFragmentPosition() const { return false; } |
| 36 |
| 37 private: |
| 38 /** |
| 39 * initBatchTracker is a hook for the some additional overrides / optimizati
on possibilities |
| 40 * from the GrXferProcessor. |
| 41 */ |
| 42 virtual void initBatchTracker(const GrPipelineOptimizations&) = 0; |
| 43 |
| 44 SkAlignedSTStorage<1, GrPipeline> fPipelineStorage; |
| 45 bool fPipelineInstalled; |
| 46 typedef GrBatch INHERITED; |
| 47 }; |
| 48 |
| 49 #endif |
OLD | NEW |