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

Unified Diff: sky/engine/core/html/canvas/WebGLRenderingContextBase.cpp

Issue 709603006: Remove a bunch of OS(MACOSX) code (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Even more Created 6 years, 1 month 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 | « no previous file | sky/engine/core/page/scrolling/ScrollingCoordinator.h » ('j') | sky/engine/wtf/StringExtras.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/html/canvas/WebGLRenderingContextBase.cpp
diff --git a/sky/engine/core/html/canvas/WebGLRenderingContextBase.cpp b/sky/engine/core/html/canvas/WebGLRenderingContextBase.cpp
index 4281a83d98fe46281e3659d52a41c51119a2a9a5..893bfd17c7f116f7e3a4672b21a3ea0473fd4446 100644
--- a/sky/engine/core/html/canvas/WebGLRenderingContextBase.cpp
+++ b/sky/engine/core/html/canvas/WebGLRenderingContextBase.cpp
@@ -2022,20 +2022,7 @@ void WebGLRenderingContextBase::generateMipmap(GLenum target)
if (!validateSettableTexFormat("generateMipmap", tex->getInternalFormat(target, 0)))
return;
- // generateMipmap won't work properly if minFilter is not NEAREST_MIPMAP_LINEAR
- // on Mac. Remove the hack once this driver bug is fixed.
-#if OS(MACOSX)
- bool needToResetMinFilter = false;
- if (tex->getMinFilter() != GL_NEAREST_MIPMAP_LINEAR) {
- webContext()->texParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_LINEAR);
- needToResetMinFilter = true;
- }
-#endif
webContext()->generateMipmap(target);
-#if OS(MACOSX)
- if (needToResetMinFilter)
- webContext()->texParameteri(target, GL_TEXTURE_MIN_FILTER, tex->getMinFilter());
-#endif
tex->generateMipmapLevelInfo();
}
@@ -3135,21 +3122,6 @@ void WebGLRenderingContextBase::readPixels(GLint x, GLint y, GLsizei width, GLsi
ScopedDrawingBufferBinder binder(drawingBuffer(), m_framebufferBinding.get());
webContext()->readPixels(x, y, width, height, format, type, data);
}
-
-#if OS(MACOSX)
- // FIXME: remove this section when GL driver bug on Mac is fixed, i.e.,
- // when alpha is off, readPixels should set alpha to 255 instead of 0.
- if (!m_framebufferBinding && !drawingBuffer()->getActualAttributes().alpha) {
- unsigned char* pixels = reinterpret_cast<unsigned char*>(data);
- for (GLsizei iy = 0; iy < height; ++iy) {
- for (GLsizei ix = 0; ix < width; ++ix) {
- pixels[3] = 255;
- pixels += 4;
- }
- pixels += padding;
- }
- }
-#endif
}
void WebGLRenderingContextBase::renderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
« no previous file with comments | « no previous file | sky/engine/core/page/scrolling/ScrollingCoordinator.h » ('j') | sky/engine/wtf/StringExtras.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698