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

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

Issue 1734163002: Replace fWillReadFragmentPosition with a bitfield (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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
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 1639 matching lines...) Expand 10 before | Expand all | Expand 10 after
1650 BoundaryMode boundaryMode, 1650 BoundaryMode boundaryMode,
1651 const SkIRect* srcBounds) 1651 const SkIRect* srcBounds)
1652 : INHERITED(texture, GrCoordTransform::MakeDivByTextureWHMatrix(texture)) 1652 : INHERITED(texture, GrCoordTransform::MakeDivByTextureWHMatrix(texture))
1653 , fLight(light) 1653 , fLight(light)
1654 , fSurfaceScale(surfaceScale) 1654 , fSurfaceScale(surfaceScale)
1655 , fFilterMatrix(matrix) 1655 , fFilterMatrix(matrix)
1656 , fBoundaryMode(boundaryMode) 1656 , fBoundaryMode(boundaryMode)
1657 , fDomain(create_domain(texture, srcBounds, GrTextureDomain::kDecal_Mode)) { 1657 , fDomain(create_domain(texture, srcBounds, GrTextureDomain::kDecal_Mode)) {
1658 fLight->ref(); 1658 fLight->ref();
1659 if (light->requiresFragmentPosition()) { 1659 if (light->requiresFragmentPosition()) {
1660 this->setWillReadFragmentPosition(); 1660 this->enableBuiltInState(kFragmentPosition_BuiltInState);
1661 } 1661 }
1662 } 1662 }
1663 1663
1664 GrLightingEffect::~GrLightingEffect() { 1664 GrLightingEffect::~GrLightingEffect() {
1665 fLight->unref(); 1665 fLight->unref();
1666 } 1666 }
1667 1667
1668 bool GrLightingEffect::onIsEqual(const GrFragmentProcessor& sBase) const { 1668 bool GrLightingEffect::onIsEqual(const GrFragmentProcessor& sBase) const {
1669 const GrLightingEffect& s = sBase.cast<GrLightingEffect>(); 1669 const GrLightingEffect& s = sBase.cast<GrLightingEffect>();
1670 return fLight->isEqual(*s.fLight) && 1670 return fLight->isEqual(*s.fLight) &&
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
2118 2118
2119 fragBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); 2119 fragBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight);
2120 } 2120 }
2121 2121
2122 #endif 2122 #endif
2123 2123
2124 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) 2124 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter)
2125 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) 2125 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter)
2126 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) 2126 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter)
2127 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 2127 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698