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

Unified Diff: src/gpu/gl/GrGLProgramDesc.cpp

Issue 1583863002: Beginning of support for texture rectangles. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLProgramDataManager.cpp ('k') | src/gpu/gl/SkGLContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLProgramDesc.cpp
diff --git a/src/gpu/gl/GrGLProgramDesc.cpp b/src/gpu/gl/GrGLProgramDesc.cpp
index 4c95e2b532adc8501e285a3d98fb19b4ce336247..5edacf5721859d86e484f882d52053dca3eacc73 100644
--- a/src/gpu/gl/GrGLProgramDesc.cpp
+++ b/src/gpu/gl/GrGLProgramDesc.cpp
@@ -7,12 +7,19 @@
#include "GrGLProgramDesc.h"
#include "GrProcessor.h"
-#include "GrGLGpu.h"
#include "GrPipeline.h"
#include "SkChecksum.h"
+#include "gl/GrGLDefines.h"
+#include "gl/GrGLTexture.h"
+#include "gl/GrGLTypes.h"
#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLCaps.h"
+static uint16_t texture_target_key(GrGLenum target) {
+ SkASSERT((uint32_t)target < SK_MaxU16);
+ return target;
+}
static void add_texture_key(GrProcessorKeyBuilder* b, const GrProcessor& proc,
const GrGLSLCaps& caps) {
@@ -25,10 +32,9 @@ static void add_texture_key(GrProcessorKeyBuilder* b, const GrProcessor& proc,
uint16_t* k16 = SkTCast<uint16_t*>(b->add32n(word32Count));
for (int i = 0; i < numTextures; ++i) {
const GrTextureAccess& access = proc.textureAccess(i);
- bool isExternal = (GR_GL_TEXTURE_EXTERNAL ==
- static_cast<GrGLTexture*>(access.getTexture())->target());
- k16[i] = caps.configTextureSwizzle(access.getTexture()->config()).asKey() |
- (isExternal ? 0xFF00 : 0x0000);
+ GrGLTexture* texture = static_cast<GrGLTexture*>(access.getTexture());
+ k16[i] = caps.configTextureSwizzle(texture->config()).asKey() |
+ (texture_target_key(texture->target()) << 16);
}
// zero the last 16 bits if the number of textures is odd.
if (numTextures & 0x1) {
« no previous file with comments | « src/gpu/gl/GrGLProgramDataManager.cpp ('k') | src/gpu/gl/SkGLContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698