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 GrClearBatch_DEFINED | 8 #ifndef GrClearBatch_DEFINED |
9 #define GrClearBatch_DEFINED | 9 #define GrClearBatch_DEFINED |
10 | 10 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 HasAABloat::kNo, IsZeroArea::kNo); | 64 HasAABloat::kNo, IsZeroArea::kNo); |
65 fRenderTarget.reset(rt); | 65 fRenderTarget.reset(rt); |
66 } | 66 } |
67 | 67 |
68 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override { | 68 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override { |
69 // This could be much more complicated. Currently we look at cases where
the new clear | 69 // This could be much more complicated. Currently we look at cases where
the new clear |
70 // contains the old clear, or when the new clear is a subset of the old
clear and is the | 70 // contains the old clear, or when the new clear is a subset of the old
clear and is the |
71 // same color. | 71 // same color. |
72 GrClearBatch* cb = t->cast<GrClearBatch>(); | 72 GrClearBatch* cb = t->cast<GrClearBatch>(); |
73 SkASSERT(cb->fRenderTarget == fRenderTarget); | 73 SkASSERT(cb->fRenderTarget == fRenderTarget); |
| 74 if (!fClip.windowRectsState().cheapEqualTo(cb->fClip.windowRectsState())
) { |
| 75 return false; |
| 76 } |
74 if (cb->contains(this)) { | 77 if (cb->contains(this)) { |
75 fClip = cb->fClip; | 78 fClip = cb->fClip; |
76 this->replaceBounds(*t); | 79 this->replaceBounds(*t); |
77 fColor = cb->fColor; | 80 fColor = cb->fColor; |
78 return true; | 81 return true; |
79 } else if (cb->fColor == fColor && this->contains(cb)) { | 82 } else if (cb->fColor == fColor && this->contains(cb)) { |
80 return true; | 83 return true; |
81 } | 84 } |
82 return false; | 85 return false; |
83 } | 86 } |
(...skipping 12 matching lines...) Expand all Loading... |
96 } | 99 } |
97 | 100 |
98 GrFixedClip fClip; | 101 GrFixedClip fClip; |
99 GrColor fColor; | 102 GrColor fColor; |
100 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget; | 103 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget; |
101 | 104 |
102 typedef GrBatch INHERITED; | 105 typedef GrBatch INHERITED; |
103 }; | 106 }; |
104 | 107 |
105 #endif | 108 #endif |
OLD | NEW |