Chromium Code Reviews| 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 #include "GrAAFillRectBatch.h" | 8 #include "GrAAFillRectBatch.h" |
| 9 | 9 |
| 10 #include "GrColor.h" | 10 #include "GrColor.h" |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 180 } | 180 } |
| 181 } | 181 } |
| 182 } | 182 } |
| 183 | 183 |
| 184 // Common functions | 184 // Common functions |
| 185 class AAFillRectBatchBase { | 185 class AAFillRectBatchBase { |
| 186 public: | 186 public: |
| 187 static const int kVertsPerInstance = kVertsPerAAFillRect; | 187 static const int kVertsPerInstance = kVertsPerAAFillRect; |
| 188 static const int kIndicesPerInstance = kIndicesPerAAFillRect; | 188 static const int kIndicesPerInstance = kIndicesPerAAFillRect; |
| 189 | 189 |
| 190 inline static const GrIndexBuffer* GetIndexBuffer(GrResourceProvider* rp) { | 190 inline static const GrIndexBuffer* GetIndexBuffer(GrResourceProvider* rp) { |
|
bsalomon
2015/08/18 20:31:03
Do these all need to be explicitly inline?
| |
| 191 return get_index_buffer(rp); | 191 return get_index_buffer(rp); |
| 192 } | 192 } |
| 193 | |
| 194 template <class Geometry> | |
| 195 inline static void SetBounds(const Geometry& geo, SkRect* outBounds) { | |
| 196 *outBounds = geo.fDevRect; | |
| 197 } | |
| 193 }; | 198 }; |
| 194 | 199 |
| 195 class AAFillRectBatchNoLocalMatrixImp : public AAFillRectBatchBase { | 200 class AAFillRectBatchNoLocalMatrixImp : public AAFillRectBatchBase { |
| 196 public: | 201 public: |
| 197 struct Geometry { | 202 struct Geometry { |
| 198 SkMatrix fViewMatrix; | 203 SkMatrix fViewMatrix; |
| 199 SkRect fRect; | 204 SkRect fRect; |
| 200 SkRect fDevRect; | 205 SkRect fDevRect; |
| 201 GrColor fColor; | 206 GrColor fColor; |
| 202 }; | 207 }; |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 325 DRAW_BATCH_TEST_DEFINE(AAFillRectBatchLocalMatrix) { | 330 DRAW_BATCH_TEST_DEFINE(AAFillRectBatchLocalMatrix) { |
| 326 GrColor color = GrRandomColor(random); | 331 GrColor color = GrRandomColor(random); |
| 327 SkMatrix viewMatrix = GrTest::TestMatrixInvertible(random); | 332 SkMatrix viewMatrix = GrTest::TestMatrixInvertible(random); |
| 328 SkMatrix localMatrix = GrTest::TestMatrix(random); | 333 SkMatrix localMatrix = GrTest::TestMatrix(random); |
| 329 SkRect rect = GrTest::TestRect(random); | 334 SkRect rect = GrTest::TestRect(random); |
| 330 SkRect devRect = GrTest::TestRect(random); | 335 SkRect devRect = GrTest::TestRect(random); |
| 331 return GrAAFillRectBatch::Create(color, viewMatrix, localMatrix, rect, devRe ct); | 336 return GrAAFillRectBatch::Create(color, viewMatrix, localMatrix, rect, devRe ct); |
| 332 } | 337 } |
| 333 | 338 |
| 334 #endif | 339 #endif |
| OLD | NEW |