| 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 GrTestBatch_DEFINED | 8 #ifndef GrTestBatch_DEFINED |
| 9 #define GrTestBatch_DEFINED | 9 #define GrTestBatch_DEFINED |
| 10 | 10 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 fOptimizations.fColorIgnored = !overrides.readsColor(); | 35 fOptimizations.fColorIgnored = !overrides.readsColor(); |
| 36 fOptimizations.fUsesLocalCoords = overrides.readsLocalCoords(); | 36 fOptimizations.fUsesLocalCoords = overrides.readsLocalCoords(); |
| 37 fOptimizations.fCoverageIgnored = !overrides.readsCoverage(); | 37 fOptimizations.fCoverageIgnored = !overrides.readsCoverage(); |
| 38 } | 38 } |
| 39 | 39 |
| 40 protected: | 40 protected: |
| 41 GrTestBatch(uint32_t classID, const SkRect& bounds, GrColor color) | 41 GrTestBatch(uint32_t classID, const SkRect& bounds, GrColor color) |
| 42 : INHERITED(classID) | 42 : INHERITED(classID) |
| 43 , fColor(color) { | 43 , fColor(color) { |
| 44 this->setBounds(bounds); | 44 // Choose some conservative values for aa bloat and zero area. |
| 45 this->setBounds(bounds, HasAABloat::kYes, IsZeroArea::kYes); |
| 45 } | 46 } |
| 46 | 47 |
| 47 struct Optimizations { | 48 struct Optimizations { |
| 48 bool fColorIgnored = false; | 49 bool fColorIgnored = false; |
| 49 bool fUsesLocalCoords = false; | 50 bool fUsesLocalCoords = false; |
| 50 bool fCoverageIgnored = false; | 51 bool fCoverageIgnored = false; |
| 51 }; | 52 }; |
| 52 | 53 |
| 53 GrColor color() const { return fColor; } | 54 GrColor color() const { return fColor; } |
| 54 const Optimizations optimizations() const { return fOptimizations; } | 55 const Optimizations optimizations() const { return fOptimizations; } |
| 55 | 56 |
| 56 private: | 57 private: |
| 57 bool onCombineIfPossible(GrBatch* t, const GrCaps&) override { | 58 bool onCombineIfPossible(GrBatch* t, const GrCaps&) override { |
| 58 return false; | 59 return false; |
| 59 } | 60 } |
| 60 | 61 |
| 61 GrColor fColor; | 62 GrColor fColor; |
| 62 Optimizations fOptimizations; | 63 Optimizations fOptimizations; |
| 63 | 64 |
| 64 typedef GrVertexBatch INHERITED; | 65 typedef GrVertexBatch INHERITED; |
| 65 }; | 66 }; |
| 66 | 67 |
| 67 #endif | 68 #endif |
| OLD | NEW |