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

Side by Side Diff: src/gpu/GrDrawContext.cpp

Issue 1309543012: Add new GM to directly exercise perspective bitmap drawing (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add AA case 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
« gm/perspshaders.cpp ('K') | « gm/perspshaders.cpp ('k') | 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 /* 2 /*
3 * Copyright 2015 Google Inc. 3 * Copyright 2015 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "GrAtlasTextContext.h" 9 #include "GrAtlasTextContext.h"
10 #include "GrBatchTest.h" 10 #include "GrBatchTest.h"
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 } 267 }
268 } 268 }
269 269
270 GrColor color = paint.getColor(); 270 GrColor color = paint.getColor();
271 bool needAA = paint.isAntiAlias() && 271 bool needAA = paint.isAntiAlias() &&
272 !pipelineBuilder.getRenderTarget()->isUnifiedMultisampled(); 272 !pipelineBuilder.getRenderTarget()->isUnifiedMultisampled();
273 273
274 // The fill path can handle rotation but not skew 274 // The fill path can handle rotation but not skew
275 // The stroke path needs the rect to remain axis aligned (no rotation or ske w) 275 // The stroke path needs the rect to remain axis aligned (no rotation or ske w)
276 // None of our draw rect calls can handle perspective yet 276 // None of our draw rect calls can handle perspective yet
277 SkASSERT(!viewMatrix.hasPerspective());
joshualitt 2015/09/02 17:37:20 Could we move this to line 281? maybe its not nece
robertphillips 2015/09/03 15:25:31 Done.
278 bool canApplyAA = width >=0 ? viewMatrix.rectStaysRect() : viewMatrix.preser vesRightAngles(); 277 bool canApplyAA = width >=0 ? viewMatrix.rectStaysRect() : viewMatrix.preser vesRightAngles();
279 278
280 if (needAA && canApplyAA) { 279 if (needAA && canApplyAA) {
281 SkRect devBoundRect; 280 SkRect devBoundRect;
282 viewMatrix.mapRect(&devBoundRect, rect); 281 viewMatrix.mapRect(&devBoundRect, rect);
283 SkAutoTUnref<GrDrawBatch> batch; 282 SkAutoTUnref<GrDrawBatch> batch;
284 if (width >= 0) { 283 if (width >= 0) {
285 batch.reset(GrRectBatchFactory::CreateAAStroke(color, viewMatrix, re ct, devBoundRect, 284 batch.reset(GrRectBatchFactory::CreateAAStroke(color, viewMatrix, re ct, devBoundRect,
286 *strokeInfo)); 285 *strokeInfo));
287 } else { 286 } else {
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 RETURN_FALSE_IF_ABANDONED 760 RETURN_FALSE_IF_ABANDONED
762 761
763 ASSERT_OWNED_RESOURCE(rt); 762 ASSERT_OWNED_RESOURCE(rt);
764 SkASSERT(rt); 763 SkASSERT(rt);
765 return true; 764 return true;
766 } 765 }
767 766
768 void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* b atch) { 767 void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* b atch) {
769 fDrawTarget->drawBatch(*pipelineBuilder, batch); 768 fDrawTarget->drawBatch(*pipelineBuilder, batch);
770 } 769 }
OLDNEW
« gm/perspshaders.cpp ('K') | « gm/perspshaders.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698