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

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

Issue 947443003: Move clip off of draw target (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: feedback inc Created 5 years, 10 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 | « src/core/SkRect.cpp ('k') | src/gpu/GrAARectRenderer.h » ('j') | 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 2011 Google Inc. 2 * Copyright 2011 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 "GrAAHairLinePathRenderer.h" 8 #include "GrAAHairLinePathRenderer.h"
9 9
10 #include "GrBatch.h" 10 #include "GrBatch.h"
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after
1021 const SkPath& path, 1021 const SkPath& path,
1022 const SkStrokeRec& stroke, 1022 const SkStrokeRec& stroke,
1023 bool) { 1023 bool) {
1024 SkScalar hairlineCoverage; 1024 SkScalar hairlineCoverage;
1025 uint8_t newCoverage = 0xff; 1025 uint8_t newCoverage = 0xff;
1026 if (IsStrokeHairlineOrEquivalent(stroke, viewMatrix, &hairlineCoverage)) { 1026 if (IsStrokeHairlineOrEquivalent(stroke, viewMatrix, &hairlineCoverage)) {
1027 newCoverage = SkScalarRoundToInt(hairlineCoverage * 0xff); 1027 newCoverage = SkScalarRoundToInt(hairlineCoverage * 0xff);
1028 } 1028 }
1029 1029
1030 SkIRect devClipBounds; 1030 SkIRect devClipBounds;
1031 target->getClip()->getConservativeBounds(pipelineBuilder->getRenderTarget(), &devClipBounds); 1031 pipelineBuilder->clip().getConservativeBounds(pipelineBuilder->getRenderTarg et(),
1032 &devClipBounds);
1032 1033
1033 // This outset was determined experimentally by running skps and gms. It pr obably could be a 1034 // This outset was determined experimentally by running skps and gms. It pr obably could be a
1034 // bit tighter 1035 // bit tighter
1035 SkRect devRect = path.getBounds(); 1036 SkRect devRect = path.getBounds();
1036 viewMatrix.mapRect(&devRect); 1037 viewMatrix.mapRect(&devRect);
1037 devRect.outset(2, 2); 1038 devRect.outset(2, 2);
1038 1039
1039 AAHairlineBatch::Geometry geometry; 1040 AAHairlineBatch::Geometry geometry;
1040 geometry.fColor = color; 1041 geometry.fColor = color;
1041 geometry.fCoverage = newCoverage; 1042 geometry.fCoverage = newCoverage;
1042 geometry.fViewMatrix = viewMatrix; 1043 geometry.fViewMatrix = viewMatrix;
1043 geometry.fPath = path; 1044 geometry.fPath = path;
1044 SkDEBUGCODE(geometry.fDevBounds = devRect;) 1045 SkDEBUGCODE(geometry.fDevBounds = devRect;)
1045 geometry.fDevClipBounds = devClipBounds; 1046 geometry.fDevClipBounds = devClipBounds;
1046 1047
1047 SkAutoTUnref<GrBatch> batch(AAHairlineBatch::Create(geometry, fLinesIndexBuf fer, 1048 SkAutoTUnref<GrBatch> batch(AAHairlineBatch::Create(geometry, fLinesIndexBuf fer,
1048 fQuadsIndexBuffer)); 1049 fQuadsIndexBuffer));
1049 target->drawBatch(pipelineBuilder, batch, &devRect); 1050 target->drawBatch(pipelineBuilder, batch, &devRect);
1050 1051
1051 return true; 1052 return true;
1052 } 1053 }
OLDNEW
« no previous file with comments | « src/core/SkRect.cpp ('k') | src/gpu/GrAARectRenderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698