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

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

Issue 2329403004: Remove unneeded bounds outset in GrDrawContext::drawVertices. (Closed)
Patch Set: Created 4 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 "GrBatchTest.h" 8 #include "GrBatchTest.h"
9 #include "GrColor.h" 9 #include "GrColor.h"
10 #include "GrDrawContext.h" 10 #include "GrDrawContext.h"
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 757
758 // TODO clients should give us bounds 758 // TODO clients should give us bounds
759 SkRect bounds; 759 SkRect bounds;
760 if (!bounds.setBoundsCheck(positions, vertexCount)) { 760 if (!bounds.setBoundsCheck(positions, vertexCount)) {
761 SkDebugf("drawVertices call empty bounds\n"); 761 SkDebugf("drawVertices call empty bounds\n");
762 return; 762 return;
763 } 763 }
764 764
765 viewMatrix.mapRect(&bounds); 765 viewMatrix.mapRect(&bounds);
766 766
767 // If we don't have AA then we outset for a half pixel in each direction to account for
768 // snapping. We also do this for the "hair" primitive types: lines and point s since they have
769 // a 1 pixel thickness in device space.
770 if (!paint.isAntiAlias() || GrIsPrimTypeLines(primitiveType) ||
771 kPoints_GrPrimitiveType == primitiveType) {
772 bounds.outset(0.5f, 0.5f);
773 }
774
775 SkAutoTUnref<GrDrawBatch> batch(new GrDrawVerticesBatch(paint.getColor(), 767 SkAutoTUnref<GrDrawBatch> batch(new GrDrawVerticesBatch(paint.getColor(),
776 primitiveType, viewM atrix, positions, 768 primitiveType, viewM atrix, positions,
777 vertexCount, indices , indexCount, 769 vertexCount, indices , indexCount,
778 colors, texCoords, b ounds)); 770 colors, texCoords, b ounds));
779 771
780 GrPipelineBuilder pipelineBuilder(paint, this->mustUseHWAA(paint)); 772 GrPipelineBuilder pipelineBuilder(paint, this->mustUseHWAA(paint));
781 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); 773 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch);
782 } 774 }
783 775
784 /////////////////////////////////////////////////////////////////////////////// 776 ///////////////////////////////////////////////////////////////////////////////
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
1428 1420
1429 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr Clip& clip, 1421 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr Clip& clip,
1430 GrDrawBatch* batch) { 1422 GrDrawBatch* batch) {
1431 ASSERT_SINGLE_OWNER 1423 ASSERT_SINGLE_OWNER
1432 RETURN_IF_ABANDONED 1424 RETURN_IF_ABANDONED
1433 SkDEBUGCODE(this->validate();) 1425 SkDEBUGCODE(this->validate();)
1434 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); 1426 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch");
1435 1427
1436 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); 1428 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch);
1437 } 1429 }
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