Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(784)

Side by Side Diff: src/gpu/batches/GrTessellatingPathRenderer.cpp

Issue 1467553002: New API for computing optimization invariants. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "GrTessellatingPathRenderer.h" 8 #include "GrTessellatingPathRenderer.h"
9 9
10 #include "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
(...skipping 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after
1390 static GrDrawBatch* Create(const GrColor& color, 1390 static GrDrawBatch* Create(const GrColor& color,
1391 const SkPath& path, 1391 const SkPath& path,
1392 const GrStrokeInfo& stroke, 1392 const GrStrokeInfo& stroke,
1393 const SkMatrix& viewMatrix, 1393 const SkMatrix& viewMatrix,
1394 SkRect clipBounds) { 1394 SkRect clipBounds) {
1395 return new TessellatingPathBatch(color, path, stroke, viewMatrix, clipBo unds); 1395 return new TessellatingPathBatch(color, path, stroke, viewMatrix, clipBo unds);
1396 } 1396 }
1397 1397
1398 const char* name() const override { return "TessellatingPathBatch"; } 1398 const char* name() const override { return "TessellatingPathBatch"; }
1399 1399
1400 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { 1400 void computeBatchToXPOverrides(GrInitInvariantOutput* color, GrInitInvariant Output* coverage,
1401 out->setKnownFourComponents(fColor); 1401 bool* usePLSDstRead) const {
1402 } 1402 color->setKnownFourComponents(fColor);
1403 1403 coverage->setUnknownSingleComponent();
1404 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { 1404 *usePLSDstRead = false;
1405 out->setUnknownSingleComponent();
1406 } 1405 }
1407 1406
1408 private: 1407 private:
1409 void initBatchTracker(const GrPipelineOptimizations& opt) override { 1408 void initBatchTracker(const GrPipelineOptimizations& opt) override {
1410 // Handle any color overrides 1409 // Handle any color overrides
1411 if (!opt.readsColor()) { 1410 if (!opt.readsColor()) {
1412 fColor = GrColor_ILLEGAL; 1411 fColor = GrColor_ILLEGAL;
1413 } 1412 }
1414 opt.getOverrideColorIfSet(&fColor); 1413 opt.getOverrideColorIfSet(&fColor);
1415 fPipelineInfo = opt; 1414 fPipelineInfo = opt;
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
1654 bool result = viewMatrix.invert(&vmi); 1653 bool result = viewMatrix.invert(&vmi);
1655 if (!result) { 1654 if (!result) {
1656 SkFAIL("Cannot invert matrix\n"); 1655 SkFAIL("Cannot invert matrix\n");
1657 } 1656 }
1658 vmi.mapRect(&clipBounds); 1657 vmi.mapRect(&clipBounds);
1659 GrStrokeInfo strokeInfo = GrTest::TestStrokeInfo(random); 1658 GrStrokeInfo strokeInfo = GrTest::TestStrokeInfo(random);
1660 return TessellatingPathBatch::Create(color, path, strokeInfo, viewMatrix, cl ipBounds); 1659 return TessellatingPathBatch::Create(color, path, strokeInfo, viewMatrix, cl ipBounds);
1661 } 1660 }
1662 1661
1663 #endif 1662 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698