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

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

Issue 85463005: remove SkFloatToScalar macro (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: add flag to expose SkFloatToScalar to chromium Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « src/effects/SkPerlinNoiseShader.cpp ('k') | src/gpu/GrEffect.cpp » ('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 "GrContext.h" 10 #include "GrContext.h"
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 if (viewM.hasPerspective()) { 755 if (viewM.hasPerspective()) {
756 if (viewM.invert(&ivm)) { 756 if (viewM.invert(&ivm)) {
757 toSrc = &ivm; 757 toSrc = &ivm;
758 } 758 }
759 } 759 }
760 devBounds->set(lines.begin(), lines.count()); 760 devBounds->set(lines.begin(), lines.count());
761 for (int i = 0; i < lineCnt; ++i) { 761 for (int i = 0; i < lineCnt; ++i) {
762 add_line(&lines[2*i], toSrc, drawState->getCoverageColor(), &verts); 762 add_line(&lines[2*i], toSrc, drawState->getCoverageColor(), &verts);
763 } 763 }
764 // All the verts computed by add_line are within sqrt(1^2 + 0.5^2) of the en d points. 764 // All the verts computed by add_line are within sqrt(1^2 + 0.5^2) of the en d points.
765 static const SkScalar kSqrtOfOneAndAQuarter = SkFloatToScalar(1.118f); 765 static const SkScalar kSqrtOfOneAndAQuarter = 1.118f;
766 // Add a little extra to account for vector normalization precision. 766 // Add a little extra to account for vector normalization precision.
767 static const SkScalar kOutset = kSqrtOfOneAndAQuarter + SK_Scalar1 / 20; 767 static const SkScalar kOutset = kSqrtOfOneAndAQuarter + SK_Scalar1 / 20;
768 devBounds->outset(kOutset, kOutset); 768 devBounds->outset(kOutset, kOutset);
769 769
770 return true; 770 return true;
771 } 771 }
772 772
773 bool GrAAHairLinePathRenderer::createBezierGeom( 773 bool GrAAHairLinePathRenderer::createBezierGeom(
774 const SkPath& path, 774 const SkPath& path,
775 GrDrawTarget* target, 775 GrDrawTarget* target,
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
1042 &devBounds); 1042 &devBounds);
1043 conics += n; 1043 conics += n;
1044 } 1044 }
1045 } 1045 }
1046 } 1046 }
1047 1047
1048 target->resetIndexSource(); 1048 target->resetIndexSource();
1049 1049
1050 return true; 1050 return true;
1051 } 1051 }
OLDNEW
« no previous file with comments | « src/effects/SkPerlinNoiseShader.cpp ('k') | src/gpu/GrEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698