Changeset 220399 in webkit
- Timestamp:
- Aug 8, 2017 6:04:40 AM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r220398 r220399 1 2017-08-08 Zan Dobersek <zdobersek@igalia.com> 2 3 [TexMap] Don't use GraphicsContext3D in ClipStack 4 https://bugs.webkit.org/show_bug.cgi?id=174776 5 6 Reviewed by Carlos Garcia Campos. 7 8 Any GraphicsContext3D object that's passed to ClipStack methods is of the 9 render-to-current-context nature, meaning there's no internally owned GL 10 context that has to be properly handled and all calls are simply passed to 11 OpenGL APIs. We should drop such (non-)usage of GraphicsContext3D in favor 12 of direct OpenGL API invocations. 13 14 This patch covers TextureMapper's ClipStack. Call sites to the apply() and 15 applyIfNeeded() are modified to not pass a reference to any 16 GraphicsContext3D object. Internally, OpenGL API entrypoints and constants 17 are used instead of GraphicsContext3D invocations. 18 19 No new tests -- no change in behavior. 20 21 * platform/graphics/texmap/BitmapTextureGL.cpp: 22 (WebCore::BitmapTextureGL::clearIfNeeded): 23 (WebCore::BitmapTextureGL::bindAsSurface): 24 * platform/graphics/texmap/ClipStack.cpp: 25 (WebCore::ClipStack::apply): 26 (WebCore::ClipStack::applyIfNeeded): 27 * platform/graphics/texmap/ClipStack.h: 28 * platform/graphics/texmap/TextureMapperGL.cpp: 29 (WebCore::TextureMapperGL::bindDefaultSurface): 30 (WebCore::TextureMapperGL::beginScissorClip): 31 (WebCore::TextureMapperGL::beginClip): 32 (WebCore::TextureMapperGL::endClip): 33 1 34 2017-08-08 Javier Fernandez <jfernandez@igalia.com> 2 35 -
trunk/Source/WebCore/platform/graphics/texmap/BitmapTextureGL.cpp
r220392 r220399 289 289 290 290 m_clipStack.reset(IntRect(IntPoint::zero(), m_textureSize), ClipStack::YAxisMode::Default); 291 m_clipStack.applyIfNeeded( *m_context3D);291 m_clipStack.applyIfNeeded(); 292 292 m_context3D->clearColor(0, 0, 0, 0); 293 293 m_context3D->clear(GraphicsContext3D::COLOR_BUFFER_BIT); … … 313 313 context3D->viewport(0, 0, m_textureSize.width(), m_textureSize.height()); 314 314 clearIfNeeded(); 315 m_clipStack.apply( *m_context3D);315 m_clipStack.apply(); 316 316 } 317 317 -
trunk/Source/WebCore/platform/graphics/texmap/ClipStack.cpp
r194577 r220399 23 23 #include "ClipStack.h" 24 24 25 #include " GraphicsContext3D.h"25 #include "TextureMapperGLHeaders.h" 26 26 27 27 namespace WebCore { … … 63 63 } 64 64 65 void ClipStack::apply( GraphicsContext3D& context)65 void ClipStack::apply() 66 66 { 67 67 if (clipState.scissorBox.isEmpty()) 68 68 return; 69 69 70 context.scissor(clipState.scissorBox.x(),70 glScissor(clipState.scissorBox.x(), 71 71 (yAxisMode == YAxisMode::Inverted) ? size.height() - clipState.scissorBox.maxY() : clipState.scissorBox.y(), 72 72 clipState.scissorBox.width(), clipState.scissorBox.height()); 73 context.stencilOp(GraphicsContext3D::KEEP, GraphicsContext3D::KEEP, GraphicsContext3D::KEEP);74 context.stencilFunc(GraphicsContext3D::EQUAL, clipState.stencilIndex - 1, clipState.stencilIndex - 1);73 glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); 74 glStencilFunc(GL_EQUAL, clipState.stencilIndex - 1, clipState.stencilIndex - 1); 75 75 if (clipState.stencilIndex == 1) 76 context.disable(GraphicsContext3D::STENCIL_TEST);76 glDisable(GL_STENCIL_TEST); 77 77 else 78 context.enable(GraphicsContext3D::STENCIL_TEST);78 glEnable(GL_STENCIL_TEST); 79 79 } 80 80 81 void ClipStack::applyIfNeeded( GraphicsContext3D& context)81 void ClipStack::applyIfNeeded() 82 82 { 83 83 if (!clipStateDirty) … … 85 85 86 86 clipStateDirty = false; 87 apply( context);87 apply(); 88 88 } 89 89 -
trunk/Source/WebCore/platform/graphics/texmap/ClipStack.h
r194577 r220399 28 28 namespace WebCore { 29 29 30 class GraphicsContext3D;31 32 30 class ClipStack { 33 31 public: … … 57 55 int getStencilIndex() const { return clipState.stencilIndex; } 58 56 59 void apply( GraphicsContext3D&);60 void applyIfNeeded( GraphicsContext3D&);57 void apply(); 58 void applyIfNeeded(); 61 59 62 60 bool isCurrentScissorBoxEmpty() const { return clipState.scissorBox.isEmpty(); } -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
r220392 r220399 654 654 data().projectionMatrix = createProjectionMatrix(IntSize(viewport[2], viewport[3]), data().PaintFlags & PaintingMirrored); 655 655 m_context3D->viewport(viewport[0], viewport[1], viewport[2], viewport[3]); 656 m_clipStack.apply( *m_context3D);656 m_clipStack.apply(); 657 657 data().currentSurface = nullptr; 658 658 } … … 690 690 691 691 clipStack().intersect(rect); 692 clipStack().applyIfNeeded( *m_context3D);692 clipStack().applyIfNeeded(); 693 693 return true; 694 694 } … … 745 745 // Increase stencilIndex and apply stencil testing. 746 746 clipStack().setStencilIndex(stencilIndex * 2); 747 clipStack().applyIfNeeded( *m_context3D);747 clipStack().applyIfNeeded(); 748 748 } 749 749 … … 751 751 { 752 752 clipStack().pop(); 753 clipStack().applyIfNeeded( *m_context3D);753 clipStack().applyIfNeeded(); 754 754 } 755 755
Note: See TracChangeset
for help on using the changeset viewer.