diff options
author | twiz@google.com <twiz@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-08-02 15:15:16 +0000 |
---|---|---|
committer | twiz@google.com <twiz@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-08-02 15:15:16 +0000 |
commit | a5e65ec434fed44dc616e4f64950b835b541181b (patch) | |
tree | ffe3592179c7c3ce78db8e5e485c641900042015 /src/gpu/GrCustomStage.cpp | |
parent | eb7ad4a8b9c67743d6aa4e71b82e32f4cf1c8a9f (diff) |
Introduction of set of functions to manage generation of texture fetch shader code.
A new set of routines have been added to GrGLShaderBuilder to emit texture fetches, taking into consideration the format of the texture to be accessed, and the channel swizzle.
Review URL: https://codereview.appspot.com/6446072
git-svn-id: http://skia.googlecode.com/svn/trunk@4919 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/GrCustomStage.cpp')
-rw-r--r-- | src/gpu/GrCustomStage.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/gpu/GrCustomStage.cpp b/src/gpu/GrCustomStage.cpp index 43de5ae271..bea07cfab4 100644 --- a/src/gpu/GrCustomStage.cpp +++ b/src/gpu/GrCustomStage.cpp @@ -8,6 +8,7 @@ #include "GrContext.h" #include "GrCustomStage.h" #include "GrMemoryPool.h" +#include "SkString.h" #include "SkTLS.h" SK_DEFINE_INST_COUNT(GrCustomStage) @@ -31,6 +32,17 @@ private: int32_t GrProgramStageFactory::fCurrStageClassID = GrProgramStageFactory::kIllegalStageClassID; +GrTextureAccess::GrTextureAccess(const GrTexture* texture, const SkString& swizzle) + : fTexture(texture) { + GrAssert(swizzle.size() <= 4); + for (unsigned int offset = 0; offset < swizzle.size(); ++offset) { + fSwizzle[offset] = swizzle[offset]; + } + if (swizzle.size() < 4) { + fSwizzle[swizzle.size()] = 0; + } +} + GrCustomStage::GrCustomStage() { } @@ -63,6 +75,10 @@ GrTexture* GrCustomStage::texture(unsigned int index) const { return NULL; } +const GrTextureAccess* GrCustomStage::textureAccess(unsigned int index) const { + return NULL; +} + void * GrCustomStage::operator new(size_t size) { return GrCustomStage_Globals::GetTLS()->allocate(size); } @@ -70,4 +86,3 @@ void * GrCustomStage::operator new(size_t size) { void GrCustomStage::operator delete(void* target) { GrCustomStage_Globals::GetTLS()->release(target); } - |