diff options
author | 2011-01-24 17:41:47 +0000 | |
---|---|---|
committer | 2011-01-24 17:41:47 +0000 | |
commit | 7d34d2eecc40d150d867e37d5160a1bc3cfccbde (patch) | |
tree | ba3561a9265b074533e820a0711901c37eabd553 /gpu/src/GrGpuGLShaders2.cpp | |
parent | 1a2e8d233d91cc4c6622ff3d975ab7d50604c923 (diff) |
Increase number of stages from 1 to 2
Move GrTextContext from stage 0 to stage 1 so it doesn't conflict with GrPaint (allow textured text)
Switch to dynamically generated shaders
git-svn-id: http://skia.googlecode.com/svn/trunk@721 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gpu/src/GrGpuGLShaders2.cpp')
-rw-r--r-- | gpu/src/GrGpuGLShaders2.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gpu/src/GrGpuGLShaders2.cpp b/gpu/src/GrGpuGLShaders2.cpp index 1218a3669a..25d0aeb927 100644 --- a/gpu/src/GrGpuGLShaders2.cpp +++ b/gpu/src/GrGpuGLShaders2.cpp @@ -236,13 +236,17 @@ static uint32_t ror(uint32_t x) { return (x >> 8) | (x << 24); } +static uint32_t rol(uint32_t x) { + return (x << 8) | (x >> 24); +} + GrGpuGLShaders2::ProgramCache::HashKey::HashKey(const ProgramDesc& desc) { fDesc = desc; // if you change the size of the desc, need to update the hash function - GR_STATIC_ASSERT(8 == sizeof(ProgramDesc)); + GR_STATIC_ASSERT(12 == sizeof(ProgramDesc)); uint32_t* d = (uint32_t*) &fDesc; - fHash = d[0] ^ ror(d[1]); + fHash = d[0] ^ ror(d[1]) ^ rol(d[2]); } bool GrGpuGLShaders2::ProgramCache::HashKey::EQ(const Entry& entry, @@ -267,7 +271,6 @@ uint32_t GrGpuGLShaders2::ProgramCache::HashKey::getHash() const { return fHash; } - struct GrGpuGLShaders2::ShaderCodeSegments { GrSStringBuilder<256> fVSUnis; GrSStringBuilder<256> fVSAttrs; |