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

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

Issue 1048333003: Set resScale on stroker when stroking path on gpu. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 5 years, 8 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 | « include/core/SkStrokeRec.h ('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 2011 Google Inc. 3 * Copyright 2011 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 "GrContext.h" 9 #include "GrContext.h"
10 10
(...skipping 1433 matching lines...) Expand 10 before | Expand all | Expand 10 after
1444 SkTLazy<SkPath> tmpPath; 1444 SkTLazy<SkPath> tmpPath;
1445 SkTCopyOnFirstWrite<SkStrokeRec> stroke(strokeInfo.getStrokeRec()); 1445 SkTCopyOnFirstWrite<SkStrokeRec> stroke(strokeInfo.getStrokeRec());
1446 1446
1447 // Try a 1st time without stroking the path and without allowing the SW rend erer 1447 // Try a 1st time without stroking the path and without allowing the SW rend erer
1448 GrPathRenderer* pr = this->getPathRenderer(target, pipelineBuilder, viewMatr ix, *pathPtr, 1448 GrPathRenderer* pr = this->getPathRenderer(target, pipelineBuilder, viewMatr ix, *pathPtr,
1449 *stroke, false, type); 1449 *stroke, false, type);
1450 1450
1451 if (NULL == pr) { 1451 if (NULL == pr) {
1452 if (!GrPathRenderer::IsStrokeHairlineOrEquivalent(*stroke, viewMatrix, N ULL)) { 1452 if (!GrPathRenderer::IsStrokeHairlineOrEquivalent(*stroke, viewMatrix, N ULL)) {
1453 // It didn't work the 1st time, so try again with the stroked path 1453 // It didn't work the 1st time, so try again with the stroked path
1454 stroke.writable()->setResScale(SkScalarAbs(viewMatrix.getMaxScale()) );
1454 if (stroke->applyToPath(tmpPath.init(), *pathPtr)) { 1455 if (stroke->applyToPath(tmpPath.init(), *pathPtr)) {
1455 pathPtr = tmpPath.get(); 1456 pathPtr = tmpPath.get();
1456 stroke.writable()->setFillStyle(); 1457 stroke.writable()->setFillStyle();
1457 if (pathPtr->isEmpty()) { 1458 if (pathPtr->isEmpty()) {
1458 return; 1459 return;
1459 } 1460 }
1460 } 1461 }
1461 } 1462 }
1462 1463
1463 // This time, allow SW renderer 1464 // This time, allow SW renderer
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
2027 } 2028 }
2028 } 2029 }
2029 2030
2030 void GrContext::removeGpuTraceMarker(const GrGpuTraceMarker* marker) { 2031 void GrContext::removeGpuTraceMarker(const GrGpuTraceMarker* marker) {
2031 fGpu->removeGpuTraceMarker(marker); 2032 fGpu->removeGpuTraceMarker(marker);
2032 if (fDrawBuffer) { 2033 if (fDrawBuffer) {
2033 fDrawBuffer->removeGpuTraceMarker(marker); 2034 fDrawBuffer->removeGpuTraceMarker(marker);
2034 } 2035 }
2035 } 2036 }
2036 2037
OLDNEW
« no previous file with comments | « include/core/SkStrokeRec.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698