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

Side by Side Diff: gm/glyph_pos.cpp

Issue 1138263002: Revert of stop calling SkScalarDiv (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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 | « experimental/StrokePathRenderer/GrStrokePathRenderer.cpp ('k') | gm/gradients.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 2014 Google Inc. 2 * Copyright 2014 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 "gm.h" 8 #include "gm.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkTypeface.h" 10 #include "SkTypeface.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 canvas->scale(3.0f, 6.0f); 75 canvas->scale(3.0f, 6.0f);
76 drawTestCase(canvas, 1.0f); 76 drawTestCase(canvas, 1.0f);
77 canvas->restore(); 77 canvas->restore();
78 78
79 // Skew test. 79 // Skew test.
80 canvas->translate(0.0f, 80.0f); 80 canvas->translate(0.0f, 80.0f);
81 canvas->save(); 81 canvas->save();
82 canvas->scale(3.0f, 3.0f); 82 canvas->scale(3.0f, 3.0f);
83 SkMatrix skew; 83 SkMatrix skew;
84 skew.setIdentity(); 84 skew.setIdentity();
85 skew.setSkewX(8.0f / 25.0f); 85 skew.setSkewX(SkScalarDiv(8.0f,
86 skew.setSkewY(2.0f / 25.0f); 86 25.0f));
87 skew.setSkewY(SkScalarDiv(2.0f,
88 25.0f));
87 canvas->concat(skew); 89 canvas->concat(skew);
88 drawTestCase(canvas, 1.0f); 90 drawTestCase(canvas, 1.0f);
89 canvas->restore(); 91 canvas->restore();
90 92
91 // Perspective test. 93 // Perspective test.
92 canvas->translate(0.0f, 80.0f); 94 canvas->translate(0.0f, 80.0f);
93 canvas->save(); 95 canvas->save();
94 SkMatrix perspective; 96 SkMatrix perspective;
95 perspective.setIdentity(); 97 perspective.setIdentity();
96 perspective.setPerspX(-SkScalarInvert(340)); 98 perspective.setPerspX(-SkScalarDiv(SK_Scalar1, 340.0f));
97 perspective.setSkewX(8.0f / 25.0f); 99 perspective.setSkewX(SkScalarDiv(8.0f,
98 perspective.setSkewY(2.0f / 25.0f); 100 25.0f));
101 perspective.setSkewY(SkScalarDiv(2.0f,
102 25.0f));
99 103
100 104
101 canvas->concat(perspective); 105 canvas->concat(perspective);
102 drawTestCase(canvas, 1.0f); 106 drawTestCase(canvas, 1.0f);
103 canvas->restore(); 107 canvas->restore();
104 } 108 }
105 109
106 void drawTestCase(SkCanvas* canvas, SkScalar textScale) { 110 void drawTestCase(SkCanvas* canvas, SkScalar textScale) {
107 SkPaint paint; 111 SkPaint paint;
108 paint.setColor(SK_ColorBLACK); 112 paint.setColor(SK_ColorBLACK);
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 192
189 static GMRegistry reg1(GlyphPosHairlineStrokeAndFillFactory); 193 static GMRegistry reg1(GlyphPosHairlineStrokeAndFillFactory);
190 static GMRegistry reg2(GlyphPosStrokeAndFillFactory); 194 static GMRegistry reg2(GlyphPosStrokeAndFillFactory);
191 static GMRegistry reg3(GlyphPosHairlineStrokeFactory); 195 static GMRegistry reg3(GlyphPosHairlineStrokeFactory);
192 static GMRegistry reg4(GlyphPosStrokeFactory); 196 static GMRegistry reg4(GlyphPosStrokeFactory);
193 static GMRegistry reg5(GlyphPosHairlineFillFactory); 197 static GMRegistry reg5(GlyphPosHairlineFillFactory);
194 static GMRegistry reg6(GlyphPosFillFactory); 198 static GMRegistry reg6(GlyphPosFillFactory);
195 199
196 200
197 } 201 }
OLDNEW
« no previous file with comments | « experimental/StrokePathRenderer/GrStrokePathRenderer.cpp ('k') | gm/gradients.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698