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

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGLTexture.h

Issue 1490043002: Implementing Blink-side validation for WebGL 2 Samplers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed zmo@'s new feedback Created 5 years 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
Index: third_party/WebKit/Source/modules/webgl/WebGLTexture.h
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLTexture.h b/third_party/WebKit/Source/modules/webgl/WebGLTexture.h
index 8c0b749f4a2e8b57acae3c40721feb0988a26448..b1fbaf26692cd56725374853059c4d16e3b4b024 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLTexture.h
+++ b/third_party/WebKit/Source/modules/webgl/WebGLTexture.h
@@ -31,6 +31,20 @@
namespace blink {
+struct WebGLSamplerState {
+ WebGLSamplerState();
+
+ GLenum compreFunc;
+ GLenum compreMode;
+ GLenum magFilter;
+ GLenum minFilter;
+ GLenum wrapR;
+ GLenum wrapS;
+ GLenum wrapT;
+ GLfloat maxLod;
+ GLfloat minLod;
+};
+
class WebGLTexture final : public WebGLSharedPlatform3DObject {
DEFINE_WRAPPERTYPEINFO();
public:
@@ -49,7 +63,7 @@ public:
GLenum getTarget() const { return m_target; }
- int getMinFilter() const { return m_minFilter; }
+ int getMinFilter() const { return m_samplerState.minFilter; }
void setLevelInfo(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum type);
void setTexStorageInfo(GLenum target, GLint levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth);
@@ -75,13 +89,15 @@ public:
bool isNPOT() const;
// Determine if texture sampling should always return [0, 0, 0, 1] (OpenGL ES 2.0 Sec 3.8.2).
- bool needToUseBlackTexture(TextureExtensionFlag) const;
+ bool needToUseBlackTexture(TextureExtensionFlag, const WebGLSamplerState*) const;
bool hasEverBeenBound() const { return object() && m_target; }
static GLint computeLevelCount(GLsizei width, GLsizei height, GLsizei depth);
static GLenum getValidTypeForInternalFormat(GLenum);
+ const WebGLSamplerState* getSamplerState() const { return &m_samplerState; }
+
private:
explicit WebGLTexture(WebGLRenderingContextBase*);
@@ -127,11 +143,7 @@ private:
GLenum m_target;
- GLenum m_minFilter;
- GLenum m_magFilter;
- GLenum m_wrapR;
- GLenum m_wrapS;
- GLenum m_wrapT;
+ WebGLSamplerState m_samplerState;
Vector<Vector<LevelInfo>> m_info;
« no previous file with comments | « third_party/WebKit/Source/modules/webgl/WebGLSampler.cpp ('k') | third_party/WebKit/Source/modules/webgl/WebGLTexture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698