OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "GrAAConvexPathRenderer.h" | 9 #include "GrAAConvexPathRenderer.h" |
10 | 10 |
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 AAConvexPathBatch(const Geometry& geometry) { | 931 AAConvexPathBatch(const Geometry& geometry) { |
932 this->initClassID<AAConvexPathBatch>(); | 932 this->initClassID<AAConvexPathBatch>(); |
933 fGeoData.push_back(geometry); | 933 fGeoData.push_back(geometry); |
934 | 934 |
935 // compute bounds | 935 // compute bounds |
936 fBounds = geometry.fPath.getBounds(); | 936 fBounds = geometry.fPath.getBounds(); |
937 geometry.fViewMatrix.mapRect(&fBounds); | 937 geometry.fViewMatrix.mapRect(&fBounds); |
938 } | 938 } |
939 | 939 |
940 bool onCombineIfPossible(GrBatch* t) override { | 940 bool onCombineIfPossible(GrBatch* t) override { |
| 941 if (!this->pipeline()->isEqual(*t->pipeline())) { |
| 942 return false; |
| 943 } |
| 944 |
941 AAConvexPathBatch* that = t->cast<AAConvexPathBatch>(); | 945 AAConvexPathBatch* that = t->cast<AAConvexPathBatch>(); |
942 | 946 |
943 if (this->color() != that->color()) { | 947 if (this->color() != that->color()) { |
944 return false; | 948 return false; |
945 } | 949 } |
946 | 950 |
947 SkASSERT(this->usesLocalCoords() == that->usesLocalCoords()); | 951 SkASSERT(this->usesLocalCoords() == that->usesLocalCoords()); |
948 if (this->usesLocalCoords() && !this->viewMatrix().cheapEqualTo(that->vi
ewMatrix())) { | 952 if (this->usesLocalCoords() && !this->viewMatrix().cheapEqualTo(that->vi
ewMatrix())) { |
949 return false; | 953 return false; |
950 } | 954 } |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1014 BATCH_TEST_DEFINE(AAConvexPathBatch) { | 1018 BATCH_TEST_DEFINE(AAConvexPathBatch) { |
1015 AAConvexPathBatch::Geometry geometry; | 1019 AAConvexPathBatch::Geometry geometry; |
1016 geometry.fColor = GrRandomColor(random); | 1020 geometry.fColor = GrRandomColor(random); |
1017 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); | 1021 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); |
1018 geometry.fPath = GrTest::TestPathConvex(random); | 1022 geometry.fPath = GrTest::TestPathConvex(random); |
1019 | 1023 |
1020 return AAConvexPathBatch::Create(geometry); | 1024 return AAConvexPathBatch::Create(geometry); |
1021 } | 1025 } |
1022 | 1026 |
1023 #endif | 1027 #endif |
OLD | NEW |