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

Side by Side Diff: src/gpu/batches/GrDrawVerticesBatch.h

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
« no previous file with comments | « src/gpu/batches/GrDrawPathBatch.cpp ('k') | src/gpu/batches/GrDrawVerticesBatch.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef GrDrawVerticesBatch_DEFINED 8 #ifndef GrDrawVerticesBatch_DEFINED
9 #define GrDrawVerticesBatch_DEFINED 9 #define GrDrawVerticesBatch_DEFINED
10 10
(...skipping 24 matching lines...) Expand all
35 const SkPoint* positions, int vertexCount, 35 const SkPoint* positions, int vertexCount,
36 const uint16_t* indices, int indexCount, 36 const uint16_t* indices, int indexCount,
37 const GrColor* colors, const SkPoint* localCoords , 37 const GrColor* colors, const SkPoint* localCoords ,
38 const SkRect& bounds) { 38 const SkRect& bounds) {
39 return new GrDrawVerticesBatch(geometry, primitiveType, viewMatrix, posi tions, vertexCount, 39 return new GrDrawVerticesBatch(geometry, primitiveType, viewMatrix, posi tions, vertexCount,
40 indices, indexCount, colors, localCoords, bounds); 40 indices, indexCount, colors, localCoords, bounds);
41 } 41 }
42 42
43 const char* name() const override { return "DrawVerticesBatch"; } 43 const char* name() const override { return "DrawVerticesBatch"; }
44 44
45 void getInvariantOutputColor(GrInitInvariantOutput* out) const override; 45 void computePipelineOptimizations(GrInitInvariantOutput* color,
46 46 GrInitInvariantOutput* coverage,
47 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override; 47 GrBatchToXPOverrides* overrides) const ove rride;
48 48
49 SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; } 49 SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
50 50
51 private: 51 private:
52 void onPrepareDraws(Target*) override; 52 void onPrepareDraws(Target*) override;
53 void initBatchTracker(const GrPipelineOptimizations&) override; 53 void initBatchTracker(const GrXPOverridesForBatch&) override;
54 54
55 GrDrawVerticesBatch(const Geometry& geometry, GrPrimitiveType primitiveType, 55 GrDrawVerticesBatch(const Geometry& geometry, GrPrimitiveType primitiveType,
56 const SkMatrix& viewMatrix, 56 const SkMatrix& viewMatrix,
57 const SkPoint* positions, int vertexCount, 57 const SkPoint* positions, int vertexCount,
58 const uint16_t* indices, int indexCount, 58 const uint16_t* indices, int indexCount,
59 const GrColor* colors, const SkPoint* localCoords, const SkRect& bounds); 59 const GrColor* colors, const SkPoint* localCoords, const SkRect& bounds);
60 60
61 GrPrimitiveType primitiveType() const { return fPrimitiveType; } 61 GrPrimitiveType primitiveType() const { return fPrimitiveType; }
62 bool batchablePrimitiveType() const { 62 bool batchablePrimitiveType() const {
63 return kTriangles_GrPrimitiveType == fPrimitiveType || 63 return kTriangles_GrPrimitiveType == fPrimitiveType ||
64 kLines_GrPrimitiveType == fPrimitiveType || 64 kLines_GrPrimitiveType == fPrimitiveType ||
65 kPoints_GrPrimitiveType == fPrimitiveType; 65 kPoints_GrPrimitiveType == fPrimitiveType;
66 } 66 }
67 67
68 bool onCombineIfPossible(GrBatch* t, const GrCaps&) override; 68 bool onCombineIfPossible(GrBatch* t, const GrCaps&) override;
69 69
70 GrPrimitiveType fPrimitiveType; 70 GrPrimitiveType fPrimitiveType;
71 SkMatrix fViewMatrix; 71 SkMatrix fViewMatrix;
72 bool fVariableColor; 72 bool fVariableColor;
73 int fVertexCount; 73 int fVertexCount;
74 int fIndexCount; 74 int fIndexCount;
75 bool fCoverageIgnored; // comes from initBatchTracker. 75 bool fCoverageIgnored; // comes from initBatchTracker.
76 76
77 SkSTArray<1, Geometry, true> fGeoData; 77 SkSTArray<1, Geometry, true> fGeoData;
78 78
79 typedef GrVertexBatch INHERITED; 79 typedef GrVertexBatch INHERITED;
80 }; 80 };
81 81
82 #endif 82 #endif
OLDNEW
« no previous file with comments | « src/gpu/batches/GrDrawPathBatch.cpp ('k') | src/gpu/batches/GrDrawVerticesBatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698