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

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

Issue 1347913004: Fix for combining with perspective local rects (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 months 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 | « no previous file | no next file » | 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 #include "GrNonAAFillRectBatch.h" 8 #include "GrNonAAFillRectBatch.h"
9 9
10 #include "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 bool fHasLocalMatrix; 150 bool fHasLocalMatrix;
151 bool fHasLocalRect; 151 bool fHasLocalRect;
152 }; 152 };
153 153
154 static const char* Name() { return "NonAAFillRectBatchPerspective"; } 154 static const char* Name() { return "NonAAFillRectBatchPerspective"; }
155 155
156 static bool CanCombine(const Geometry& mine, const Geometry& theirs, 156 static bool CanCombine(const Geometry& mine, const Geometry& theirs,
157 const GrPipelineOptimizations& opts) { 157 const GrPipelineOptimizations& opts) {
158 // We could batch across perspective vm changes if we really wanted to 158 // We could batch across perspective vm changes if we really wanted to
159 return mine.fViewMatrix.cheapEqualTo(theirs.fViewMatrix) && 159 return mine.fViewMatrix.cheapEqualTo(theirs.fViewMatrix) &&
160 mine.fHasLocalRect == theirs.fHasLocalRect &&
160 (!mine.fHasLocalMatrix || mine.fLocalMatrix.cheapEqualTo(theirs.f LocalMatrix)); 161 (!mine.fHasLocalMatrix || mine.fLocalMatrix.cheapEqualTo(theirs.f LocalMatrix));
161 } 162 }
162 163
163 static const GrGeometryProcessor* CreateGP(const Geometry& geo, 164 static const GrGeometryProcessor* CreateGP(const Geometry& geo,
164 const GrPipelineOptimizations& op ts) { 165 const GrPipelineOptimizations& op ts) {
165 const GrGeometryProcessor* gp = create_gp(geo.fViewMatrix, opts.readsCov erage(), 166 const GrGeometryProcessor* gp = create_gp(geo.fViewMatrix, opts.readsCov erage(),
166 geo.fHasLocalRect, 167 geo.fHasLocalRect,
167 geo.fHasLocalMatrix ? &geo.fLo calMatrix : 168 geo.fHasLocalMatrix ? &geo.fLo calMatrix :
168 nullptr) ; 169 nullptr) ;
169 170
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 SkMatrix localMatrix = GrTest::TestMatrix(random); 258 SkMatrix localMatrix = GrTest::TestMatrix(random);
258 259
259 bool hasLocalRect = random->nextBool(); 260 bool hasLocalRect = random->nextBool();
260 bool hasLocalMatrix = random->nextBool(); 261 bool hasLocalMatrix = random->nextBool();
261 return GrNonAAFillRectBatch::Create(color, viewMatrix, rect, 262 return GrNonAAFillRectBatch::Create(color, viewMatrix, rect,
262 hasLocalRect ? &localRect : nullptr, 263 hasLocalRect ? &localRect : nullptr,
263 hasLocalMatrix ? &localMatrix : nullptr) ; 264 hasLocalMatrix ? &localMatrix : nullptr) ;
264 } 265 }
265 266
266 #endif 267 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698