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

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: Addressed code review comments 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 | « 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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 } 266 }
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 AA draw rect calls can handle perspective yet
277 SkASSERT(!viewMatrix.hasPerspective());
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) {
280 SkASSERT(!viewMatrix.hasPerspective());
281 SkRect devBoundRect; 281 SkRect devBoundRect;
282 viewMatrix.mapRect(&devBoundRect, rect); 282 viewMatrix.mapRect(&devBoundRect, rect);
283 SkAutoTUnref<GrDrawBatch> batch; 283 SkAutoTUnref<GrDrawBatch> batch;
284 if (width >= 0) { 284 if (width >= 0) {
285 batch.reset(GrRectBatchFactory::CreateAAStroke(color, viewMatrix, re ct, devBoundRect, 285 batch.reset(GrRectBatchFactory::CreateAAStroke(color, viewMatrix, re ct, devBoundRect,
286 *strokeInfo)); 286 *strokeInfo));
287 } else { 287 } else {
288 batch.reset(GrRectBatchFactory::CreateAAFill(color, viewMatrix, rect , devBoundRect)); 288 batch.reset(GrRectBatchFactory::CreateAAFill(color, viewMatrix, rect , devBoundRect));
289 } 289 }
290 fDrawTarget->drawBatch(pipelineBuilder, batch); 290 fDrawTarget->drawBatch(pipelineBuilder, batch);
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 RETURN_FALSE_IF_ABANDONED 761 RETURN_FALSE_IF_ABANDONED
762 762
763 ASSERT_OWNED_RESOURCE(rt); 763 ASSERT_OWNED_RESOURCE(rt);
764 SkASSERT(rt); 764 SkASSERT(rt);
765 return true; 765 return true;
766 } 766 }
767 767
768 void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* b atch) { 768 void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* b atch) {
769 fDrawTarget->drawBatch(*pipelineBuilder, batch); 769 fDrawTarget->drawBatch(*pipelineBuilder, batch);
770 } 770 }
OLDNEW
« no previous file with comments | « gm/perspshaders.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698