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

Side by Side Diff: src/gpu/batches/GrDrawVerticesBatch.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 "GrDrawVerticesBatch.h" 8 #include "GrDrawVerticesBatch.h"
9 9
10 #include "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 if (localCoords) { 58 if (localCoords) {
59 installedGeo.fLocalCoords.append(vertexCount, localCoords); 59 installedGeo.fLocalCoords.append(vertexCount, localCoords);
60 } 60 }
61 fVertexCount = vertexCount; 61 fVertexCount = vertexCount;
62 fIndexCount = indexCount; 62 fIndexCount = indexCount;
63 fPrimitiveType = primitiveType; 63 fPrimitiveType = primitiveType;
64 64
65 this->setBounds(bounds); 65 this->setBounds(bounds);
66 } 66 }
67 67
68 void GrDrawVerticesBatch::getInvariantOutputColor(GrInitInvariantOutput* out) co nst { 68 void GrDrawVerticesBatch::computeBatchToXPOverrides(GrInitInvariantOutput* color ,
69 GrInitInvariantOutput* cover age,
70 bool* usePLSDstRead) const {
69 // When this is called on a batch, there is only one geometry bundle 71 // When this is called on a batch, there is only one geometry bundle
70 if (fVariableColor) { 72 if (fVariableColor) {
71 out->setUnknownFourComponents(); 73 color->setUnknownFourComponents();
72 } else { 74 } else {
73 out->setKnownFourComponents(fGeoData[0].fColor); 75 color->setKnownFourComponents(fGeoData[0].fColor);
74 } 76 }
75 } 77 coverage->setKnownSingleComponent(0xff);
76 78 *usePLSDstRead = false;
77 void GrDrawVerticesBatch::getInvariantOutputCoverage(GrInitInvariantOutput* out) const {
78 out->setKnownSingleComponent(0xff);
79 } 79 }
80 80
81 void GrDrawVerticesBatch::initBatchTracker(const GrPipelineOptimizations& opt) { 81 void GrDrawVerticesBatch::initBatchTracker(const GrPipelineOptimizations& opt) {
82 SkASSERT(fGeoData.count() == 1); 82 SkASSERT(fGeoData.count() == 1);
83 GrColor overrideColor; 83 GrColor overrideColor;
84 if (opt.getOverrideColorIfSet(&overrideColor)) { 84 if (opt.getOverrideColorIfSet(&overrideColor)) {
85 fGeoData[0].fColor = overrideColor; 85 fGeoData[0].fColor = overrideColor;
86 fGeoData[0].fColors.reset(); 86 fGeoData[0].fColors.reset();
87 fVariableColor = false; 87 fVariableColor = false;
88 } 88 }
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 geometry.fColor = GrRandomColor(random); 318 geometry.fColor = GrRandomColor(random);
319 return GrDrawVerticesBatch::Create(geometry, type, viewMatrix, 319 return GrDrawVerticesBatch::Create(geometry, type, viewMatrix,
320 positions.begin(), vertexCount, 320 positions.begin(), vertexCount,
321 indices.begin(), hasIndices ? vertexCount : 0, 321 indices.begin(), hasIndices ? vertexCount : 0,
322 colors.begin(), 322 colors.begin(),
323 texCoords.begin(), 323 texCoords.begin(),
324 bounds); 324 bounds);
325 } 325 }
326 326
327 #endif 327 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698