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

Unified Diff: Source/core/html/canvas/WebGLTexture.cpp

Issue 14860016: Implement OES_texture_float_linear and OES_texture_half_float_linear extensions in WebGL. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 7 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 | « Source/core/html/canvas/WebGLTexture.h ('k') | Source/core/platform/graphics/Extensions3D.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/canvas/WebGLTexture.cpp
diff --git a/Source/core/html/canvas/WebGLTexture.cpp b/Source/core/html/canvas/WebGLTexture.cpp
index c8c23bd4be545a9c05708dcf75ca32171cb10ca0..c5d2bff5446ba69dec7f58f3b38cd8c397ccb980 100644
--- a/Source/core/html/canvas/WebGLTexture.cpp
+++ b/Source/core/html/canvas/WebGLTexture.cpp
@@ -48,6 +48,8 @@ WebGLTexture::WebGLTexture(WebGLRenderingContext* ctx)
, m_isNPOT(false)
, m_isComplete(false)
, m_needToUseBlackTexture(false)
+ , m_isFloatType(false)
+ , m_isHalfFloatType(false)
{
setObject(ctx->graphicsContext3D()->createTexture());
}
@@ -230,11 +232,17 @@ bool WebGLTexture::isNPOT() const
return m_isNPOT;
}
-bool WebGLTexture::needToUseBlackTexture() const
+bool WebGLTexture::needToUseBlackTexture(TextureExtensionFlag flag) const
{
if (!object())
return false;
- return m_needToUseBlackTexture;
+ if (m_needToUseBlackTexture)
+ return true;
+ if ((m_isFloatType && !(flag & TextureFloatLinearExtensionEnabled)) || (m_isHalfFloatType && !(flag && TextureHalfFloatLinearExtensionEnabled))) {
+ if (m_magFilter != GraphicsContext3D::NEAREST || (m_minFilter != GraphicsContext3D::NEAREST && m_minFilter != GraphicsContext3D::NEAREST_MIPMAP_NEAREST))
+ return true;
+ }
+ return false;
}
void WebGLTexture::deleteObjectImpl(GraphicsContext3D* context3d, Platform3DObject object)
@@ -340,6 +348,28 @@ void WebGLTexture::update()
}
}
}
+ m_isFloatType = false;
+ if (m_isComplete)
+ m_isFloatType = m_info[0][0].type == GraphicsContext3D::FLOAT;
+ else {
+ for (size_t ii = 0; ii < m_info.size(); ++ii) {
+ if (m_info[ii][0].type == GraphicsContext3D::FLOAT) {
+ m_isFloatType = true;
+ break;
+ }
+ }
+ }
Ken Russell (switch to Gerrit) 2013/05/20 19:46:45 OK. It still isn't clear to me that scanning throu
+ m_isHalfFloatType = false;
+ if (m_isComplete)
+ m_isHalfFloatType = m_info[0][0].type == GraphicsContext3D::HALF_FLOAT_OES;
+ else {
+ for (size_t ii = 0; ii < m_info.size(); ++ii) {
+ if (m_info[ii][0].type == GraphicsContext3D::HALF_FLOAT_OES) {
+ m_isHalfFloatType = true;
+ break;
+ }
+ }
+ }
m_needToUseBlackTexture = false;
// NPOT
« no previous file with comments | « Source/core/html/canvas/WebGLTexture.h ('k') | Source/core/platform/graphics/Extensions3D.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698