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

Side by Side Diff: src/effects/SkLightingImageFilter.cpp

Issue 522873005: Move MakeDivByTextureWHMatrix to GrCoordTransform (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 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/effects/SkDisplacementMapEffect.cpp ('k') | src/effects/SkMagnifierImageFilter.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 2012 The Android Open Source Project 2 * Copyright 2012 The Android Open Source Project
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 "SkLightingImageFilter.h" 8 #include "SkLightingImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 1254 matching lines...) Expand 10 before | Expand all | Expand 10 after
1265 UniformHandle fKSUni; 1265 UniformHandle fKSUni;
1266 UniformHandle fShininessUni; 1266 UniformHandle fShininessUni;
1267 }; 1267 };
1268 1268
1269 /////////////////////////////////////////////////////////////////////////////// 1269 ///////////////////////////////////////////////////////////////////////////////
1270 1270
1271 GrLightingEffect::GrLightingEffect(GrTexture* texture, 1271 GrLightingEffect::GrLightingEffect(GrTexture* texture,
1272 const SkLight* light, 1272 const SkLight* light,
1273 SkScalar surfaceScale, 1273 SkScalar surfaceScale,
1274 const SkMatrix& matrix) 1274 const SkMatrix& matrix)
1275 : INHERITED(texture, MakeDivByTextureWHMatrix(texture)) 1275 : INHERITED(texture, GrCoordTransform::MakeDivByTextureWHMatrix(texture))
1276 , fLight(light) 1276 , fLight(light)
1277 , fSurfaceScale(surfaceScale) 1277 , fSurfaceScale(surfaceScale)
1278 , fFilterMatrix(matrix) { 1278 , fFilterMatrix(matrix) {
1279 fLight->ref(); 1279 fLight->ref();
1280 if (light->requiresFragmentPosition()) { 1280 if (light->requiresFragmentPosition()) {
1281 this->setWillReadFragmentPosition(); 1281 this->setWillReadFragmentPosition();
1282 } 1282 }
1283 } 1283 }
1284 1284
1285 GrLightingEffect::~GrLightingEffect() { 1285 GrLightingEffect::~GrLightingEffect() {
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
1703 1703
1704 fsBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); 1704 fsBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight);
1705 } 1705 }
1706 1706
1707 #endif 1707 #endif
1708 1708
1709 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) 1709 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter)
1710 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) 1710 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter)
1711 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) 1711 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter)
1712 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 1712 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « src/effects/SkDisplacementMapEffect.cpp ('k') | src/effects/SkMagnifierImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698