diff options
Diffstat (limited to 'include/gpu')
-rw-r--r-- | include/gpu/GrCustomStage.h | 21 | ||||
-rw-r--r-- | include/gpu/GrTextureAccess.h | 36 |
2 files changed, 37 insertions, 20 deletions
diff --git a/include/gpu/GrCustomStage.h b/include/gpu/GrCustomStage.h index fd5d7e00dc..32d40b47d7 100644 --- a/include/gpu/GrCustomStage.h +++ b/include/gpu/GrCustomStage.h @@ -12,31 +12,12 @@ #include "GrNoncopyable.h" #include "GrProgramStageFactory.h" #include "GrCustomStageUnitTest.h" +#include "GrTextureAccess.h" class GrContext; class GrTexture; class SkString; -/** A class representing the swizzle access pattern for a texture. - */ -class GrTextureAccess { -public: - typedef char Swizzle[4]; - - GrTextureAccess(const GrTexture* texture, const SkString& swizzle); - - const GrTexture* getTexture() const { return fTexture; } - const Swizzle& getSwizzle() const { return fSwizzle; } - - bool referencesAlpha() const { - return fSwizzle[0] == 'a' || fSwizzle[1] == 'a' || fSwizzle[2] == 'a' || fSwizzle[3] == 'a'; - } - -private: - const GrTexture* fTexture; - Swizzle fSwizzle; -}; - /** Provides custom vertex shader, fragment shader, uniform data for a particular stage of the Ganesh shading pipeline. Subclasses must have a function that produces a human-readable name: diff --git a/include/gpu/GrTextureAccess.h b/include/gpu/GrTextureAccess.h new file mode 100644 index 0000000000..55c0a02b87 --- /dev/null +++ b/include/gpu/GrTextureAccess.h @@ -0,0 +1,36 @@ +/* + * Copyright 2012 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#ifndef GrTextureAccess_DEFINED +#define GrTextureAccess_DEFINED + +#include "GrTypes.h" + +class GrTexture; +class SkString; + +/** A class representing the swizzle access pattern for a texture. + */ +class GrTextureAccess { +public: + typedef char Swizzle[4]; + + GrTextureAccess(const GrTexture* texture, const SkString& swizzle); + + const GrTexture* getTexture() const { return fTexture; } + const Swizzle& getSwizzle() const { return fSwizzle; } + + bool referencesAlpha() const { + return fSwizzle[0] == 'a' || fSwizzle[1] == 'a' || fSwizzle[2] == 'a' || fSwizzle[3] == 'a'; + } + +private: + const GrTexture* fTexture; + Swizzle fSwizzle; +}; + +#endif |