Changeset 267711 in webkit
- Timestamp:
- Sep 28, 2020, 1:04:47 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/transforms/3d/general/preserve-3d-expected.html (added)
-
LayoutTests/transforms/3d/general/preserve-3d.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/graphics/egl/GLContextEGL.cpp (modified) (1 diff)
-
Source/WebCore/platform/graphics/texmap/TextureMapper.h (modified) (1 diff)
-
Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp (modified) (3 diffs)
-
Source/WebCore/platform/graphics/texmap/TextureMapperGL.h (modified) (1 diff)
-
Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r267703 r267711 1 2020-09-28 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 [TextureMapper] Enable a depth buffer for preserve-3d 4 https://bugs.webkit.org/show_bug.cgi?id=90078 5 6 Reviewed by Don Olmstead. 7 8 * transforms/3d/general/preserve-3d-expected.html: Added. 9 * transforms/3d/general/preserve-3d.html: Added. 10 1 11 2020-09-28 Zalan Bujtas <zalan@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r267709 r267711 1 2020-09-28 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 [TextureMapper] Enable a depth buffer for preserve-3d 4 https://bugs.webkit.org/show_bug.cgi?id=90078 5 6 Reviewed by Don Olmstead. 7 8 Test: transforms/3d/general/preserve-3d.html 9 10 * platform/graphics/egl/GLContextEGL.cpp: 11 (WebCore::GLContextEGL::getEGLConfig): 12 * platform/graphics/texmap/TextureMapper.h: 13 (WebCore::TextureMapper::beginPreserves3D): Added a new virtual method. 14 (WebCore::TextureMapper::endPreserves3D): Ditto. 15 * platform/graphics/texmap/TextureMapperGL.cpp: 16 (WebCore::TextureMapperGL::beginPainting): 17 (WebCore::createProjectionMatrix): Swapped nearValue and farValue 18 so that the depth buffer works as expected. 19 (WebCore::TextureMapperGL::beginPreserves3D): Added. 20 (WebCore::TextureMapperGL::endPreserves3D): Ditto. 21 * platform/graphics/texmap/TextureMapperGL.h: 22 * platform/graphics/texmap/TextureMapperLayer.cpp: 23 (WebCore::TextureMapperLayer::paintSelfAndChildren): Call 24 beginPreserves3D() and endPreserves3D() if m_state.preserves3D. 25 1 26 2020-09-28 Devin Rousso <drousso@apple.com> 2 27 -
trunk/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp
r265031 r267711 119 119 EGL_STENCIL_SIZE, 8, 120 120 EGL_SURFACE_TYPE, EGL_NONE, 121 EGL_DEPTH_SIZE, 8, 121 122 EGL_NONE 122 123 }; -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapper.h
r241120 r267711 79 79 virtual void endClip() = 0; 80 80 virtual IntRect clipBounds() = 0; 81 virtual void beginPreserves3D() { }; 82 virtual void endPreserves3D() { }; 81 83 virtual Ref<BitmapTexture> createTexture() = 0; 82 84 virtual Ref<BitmapTexture> createTexture(int internalFormat) = 0; -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
r263941 r267711 202 202 data().previousDepthState = glIsEnabled(GL_DEPTH_TEST); 203 203 glDisable(GL_DEPTH_TEST); 204 glDepthFunc(GL_LEQUAL); 204 205 glEnable(GL_SCISSOR_TEST); 205 206 data().didModifyStencil = false; 206 glDepthMask(0);207 207 glGetIntegerv(GL_VIEWPORT, data().viewport); 208 208 glGetIntegerv(GL_SCISSOR_BOX, data().previousScissor); … … 825 825 static inline TransformationMatrix createProjectionMatrix(const IntSize& size, bool mirrored) 826 826 { 827 const float nearValue = 9999999;828 const float farValue = -99999;827 const float nearValue = -99999; 828 const float farValue = 9999999; 829 829 830 830 return TransformationMatrix(2.0 / float(size.width()), 0, 0, 0, … … 950 950 } 951 951 952 void TextureMapperGL::beginPreserves3D() 953 { 954 glEnable(GL_DEPTH_TEST); 955 glClear(GL_DEPTH_BUFFER_BIT); 956 } 957 958 void TextureMapperGL::endPreserves3D() 959 { 960 glDisable(GL_DEPTH_TEST); 961 } 962 952 963 Ref<BitmapTexture> TextureMapperGL::createTexture(GLint internalFormat) 953 964 { -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.h
r258197 r267711 80 80 void endPainting() override; 81 81 void endClip() override; 82 void beginPreserves3D() override; 83 void endPreserves3D() override; 82 84 IntRect clipBounds() override; 83 85 IntSize maxTextureSize() const override { return IntSize(2000, 2000); } -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
r264968 r267711 223 223 return; 224 224 225 if (m_state.preserves3D) 226 options.textureMapper.beginPreserves3D(); 227 225 228 if (m_state.backdropLayer && !options.backdropLayer) { 226 229 TransformationMatrix clipTransform; … … 235 238 paintSelf(options); 236 239 237 if (m_children.isEmpty()) 238 return; 240 if (m_children.isEmpty()) { 241 if (m_state.preserves3D) 242 options.textureMapper.endPreserves3D(); 243 return; 244 } 239 245 240 246 bool shouldClip = m_state.masksToBounds && !m_state.preserves3D; … … 260 266 if (shouldClip) 261 267 options.textureMapper.endClip(); 268 if (m_state.preserves3D) 269 options.textureMapper.endPreserves3D(); 262 270 } 263 271
Note:
See TracChangeset
for help on using the changeset viewer.