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

Side by Side Diff: gm/lightingshader.cpp

Issue 1842753002: Style bikeshed - remove extraneous whitespace (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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 | « gm/lcdtext.cpp ('k') | gm/localmatriximagefilter.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 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 "gm.h" 8 #include "gm.h"
9 9
10 #include "SkLightingShader.h" 10 #include "SkLightingShader.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 fNormalMaps[kFrustum_NormalMap] = make_frustum_normalmap(kTexSize); 85 fNormalMaps[kFrustum_NormalMap] = make_frustum_normalmap(kTexSize);
86 fNormalMaps[kTetra_NormalMap] = make_tetra_normalmap(kTexSize); 86 fNormalMaps[kTetra_NormalMap] = make_tetra_normalmap(kTexSize);
87 } 87 }
88 88
89 void drawRect(SkCanvas* canvas, const SkRect& r, NormalMap mapType) { 89 void drawRect(SkCanvas* canvas, const SkRect& r, NormalMap mapType) {
90 90
91 SkRect bitmapBounds = SkRect::MakeIWH(fDiffuse.width(), fDiffuse.height( )); 91 SkRect bitmapBounds = SkRect::MakeIWH(fDiffuse.width(), fDiffuse.height( ));
92 92
93 SkMatrix matrix; 93 SkMatrix matrix;
94 matrix.setRectToRect(bitmapBounds, r, SkMatrix::kFill_ScaleToFit); 94 matrix.setRectToRect(bitmapBounds, r, SkMatrix::kFill_ScaleToFit);
95 95
96 const SkMatrix& ctm = canvas->getTotalMatrix(); 96 const SkMatrix& ctm = canvas->getTotalMatrix();
97 97
98 // TODO: correctly pull out the pure rotation 98 // TODO: correctly pull out the pure rotation
99 SkVector invNormRotation = { ctm[SkMatrix::kMScaleX], ctm[SkMatrix::kMSk ewY] }; 99 SkVector invNormRotation = { ctm[SkMatrix::kMScaleX], ctm[SkMatrix::kMSk ewY] };
100 100
101 SkPaint paint; 101 SkPaint paint;
102 paint.setShader(SkLightingShader::Make(fDiffuse, fNormalMaps[mapType], f Lights, 102 paint.setShader(SkLightingShader::Make(fDiffuse, fNormalMaps[mapType], f Lights,
103 invNormRotation, &matrix, &matrix )); 103 invNormRotation, &matrix, &matrix ));
104 104
105 canvas->drawRect(r, paint); 105 canvas->drawRect(r, paint);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 167
168 SkAutoTUnref<const SkLightingShader::Lights> fLights; 168 SkAutoTUnref<const SkLightingShader::Lights> fLights;
169 169
170 typedef GM INHERITED; 170 typedef GM INHERITED;
171 }; 171 };
172 172
173 ////////////////////////////////////////////////////////////////////////////// 173 //////////////////////////////////////////////////////////////////////////////
174 174
175 DEF_GM(return new LightingShaderGM;) 175 DEF_GM(return new LightingShaderGM;)
176 } 176 }
OLDNEW
« no previous file with comments | « gm/lcdtext.cpp ('k') | gm/localmatriximagefilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698