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 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
933 private: | 933 private: |
934 AAConvexPathBatch(const Geometry& geometry) { | 934 AAConvexPathBatch(const Geometry& geometry) { |
935 this->initClassID<AAConvexPathBatch>(); | 935 this->initClassID<AAConvexPathBatch>(); |
936 fGeoData.push_back(geometry); | 936 fGeoData.push_back(geometry); |
937 | 937 |
938 // compute bounds | 938 // compute bounds |
939 fBounds = geometry.fPath.getBounds(); | 939 fBounds = geometry.fPath.getBounds(); |
940 geometry.fViewMatrix.mapRect(&fBounds); | 940 geometry.fViewMatrix.mapRect(&fBounds); |
941 } | 941 } |
942 | 942 |
943 bool onCombineIfPossible(GrBatch* t) override { | 943 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override { |
944 if (!this->pipeline()->isEqual(*t->pipeline())) { | 944 if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *t->pipel
ine(), t->bounds(), |
| 945 caps)) { |
945 return false; | 946 return false; |
946 } | 947 } |
947 | 948 |
948 AAConvexPathBatch* that = t->cast<AAConvexPathBatch>(); | 949 AAConvexPathBatch* that = t->cast<AAConvexPathBatch>(); |
949 | 950 |
950 if (this->color() != that->color()) { | 951 if (this->color() != that->color()) { |
951 return false; | 952 return false; |
952 } | 953 } |
953 | 954 |
954 SkASSERT(this->usesLocalCoords() == that->usesLocalCoords()); | 955 SkASSERT(this->usesLocalCoords() == that->usesLocalCoords()); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1015 BATCH_TEST_DEFINE(AAConvexPathBatch) { | 1016 BATCH_TEST_DEFINE(AAConvexPathBatch) { |
1016 AAConvexPathBatch::Geometry geometry; | 1017 AAConvexPathBatch::Geometry geometry; |
1017 geometry.fColor = GrRandomColor(random); | 1018 geometry.fColor = GrRandomColor(random); |
1018 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); | 1019 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); |
1019 geometry.fPath = GrTest::TestPathConvex(random); | 1020 geometry.fPath = GrTest::TestPathConvex(random); |
1020 | 1021 |
1021 return AAConvexPathBatch::Create(geometry); | 1022 return AAConvexPathBatch::Create(geometry); |
1022 } | 1023 } |
1023 | 1024 |
1024 #endif | 1025 #endif |
OLD | NEW |