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

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

Issue 1287103003: Add override to GrAAFillRectBatch::onCombineIfPossible (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 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 "GrAAFillRectBatch.h" 8 #include "GrAAFillRectBatch.h"
9 9
10 #include "GrBatch.h" 10 #include "GrBatch.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 gAAFillRectIndexBufferKey); 168 gAAFillRectIndexBufferKey);
169 } 169 }
170 170
171 GrColor color() const { return fBatch.fColor; } 171 GrColor color() const { return fBatch.fColor; }
172 bool usesLocalCoords() const { return fBatch.fUsesLocalCoords; } 172 bool usesLocalCoords() const { return fBatch.fUsesLocalCoords; }
173 bool canTweakAlphaForCoverage() const { return fBatch.fCanTweakAlphaForCover age; } 173 bool canTweakAlphaForCoverage() const { return fBatch.fCanTweakAlphaForCover age; }
174 bool colorIgnored() const { return fBatch.fColorIgnored; } 174 bool colorIgnored() const { return fBatch.fColorIgnored; }
175 const SkMatrix& viewMatrix() const { return fGeoData[0].fViewMatrix; } 175 const SkMatrix& viewMatrix() const { return fGeoData[0].fViewMatrix; }
176 bool coverageIgnored() const { return fBatch.fCoverageIgnored; } 176 bool coverageIgnored() const { return fBatch.fCoverageIgnored; }
177 177
178 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) { 178 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override {
179 if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *t->pipel ine(), t->bounds(), 179 if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *t->pipel ine(), t->bounds(),
180 caps)) { 180 caps)) {
181 return false; 181 return false;
182 } 182 }
183 183
184 AAFillRectBatch* that = t->cast<AAFillRectBatch>(); 184 AAFillRectBatch* that = t->cast<AAFillRectBatch>();
185 185
186 SkASSERT(this->usesLocalCoords() == that->usesLocalCoords()); 186 SkASSERT(this->usesLocalCoords() == that->usesLocalCoords());
187 // We apply the viewmatrix to the rect points on the cpu. However, if t he pipeline uses 187 // We apply the viewmatrix to the rect points on the cpu. However, if t he pipeline uses
188 // local coords then we won't be able to batch. We could actually uploa d the viewmatrix 188 // local coords then we won't be able to batch. We could actually uploa d the viewmatrix
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 330
331 BATCH_TEST_DEFINE(AAFillRectBatch) { 331 BATCH_TEST_DEFINE(AAFillRectBatch) {
332 GrColor color = GrRandomColor(random); 332 GrColor color = GrRandomColor(random);
333 SkMatrix viewMatrix = GrTest::TestMatrix(random); 333 SkMatrix viewMatrix = GrTest::TestMatrix(random);
334 SkRect rect = GrTest::TestRect(random); 334 SkRect rect = GrTest::TestRect(random);
335 SkRect devRect = GrTest::TestRect(random); 335 SkRect devRect = GrTest::TestRect(random);
336 return AAFillRectBatch::Create(color, viewMatrix, rect, devRect); 336 return AAFillRectBatch::Create(color, viewMatrix, rect, devRect);
337 } 337 }
338 338
339 #endif 339 #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