Changeset 122189 in webkit
- Timestamp:
- Jul 9, 2012 8:27:37 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r122188 r122189 1 2012-07-09 Alexandru Chiculita <achicu@adobe.com> 2 3 [CSS Shaders] The FECustomFilter is not making the GL context active 4 https://bugs.webkit.org/show_bug.cgi?id=90840 5 6 Reviewed by Dean Jackson. 7 8 I've added a couple of makeContextCurrent() in the FECustomFilter related classes. 9 Also, removed the assumption that GraphicsContext3D::create() never returns 0. 10 11 No new tests, this was crashing on existing tests. 12 13 * platform/graphics/filters/CustomFilterCompiledProgram.cpp: 14 (WebCore::CustomFilterCompiledProgram::CustomFilterCompiledProgram): 15 (WebCore::CustomFilterCompiledProgram::~CustomFilterCompiledProgram): 16 * platform/graphics/filters/CustomFilterGlobalContext.cpp: 17 (WebCore::CustomFilterGlobalContext::prepareContextIfNeeded): 18 * platform/graphics/filters/CustomFilterMesh.cpp: 19 (WebCore::CustomFilterMesh::CustomFilterMesh): 20 (WebCore::CustomFilterMesh::~CustomFilterMesh): 21 * platform/graphics/filters/FECustomFilter.cpp: 22 (WebCore::FECustomFilter::deleteRenderBuffers): 23 (WebCore::FECustomFilter::platformApplySoftware): 24 (WebCore::FECustomFilter::initializeContext): 25 * platform/graphics/filters/FECustomFilter.h: 26 (FECustomFilter): 27 1 28 2012-07-09 Kent Tamura <tkent@chromium.org> 2 29 -
trunk/Source/WebCore/platform/graphics/filters/CustomFilterCompiledProgram.cpp
r122175 r122189 88 88 , m_isInitialized(false) 89 89 { 90 m_context->makeContextCurrent(); 91 90 92 Platform3DObject vertexShader = compileShader(GraphicsContext3D::VERTEX_SHADER, m_vertexShaderString); 91 93 if (!vertexShader) … … 172 174 CustomFilterCompiledProgram::~CustomFilterCompiledProgram() 173 175 { 174 if (m_program) 176 if (m_program) { 177 m_context->makeContextCurrent(); 175 178 m_context->deleteProgram(m_program); 179 } 176 180 } 177 181 -
trunk/Source/WebCore/platform/graphics/filters/CustomFilterGlobalContext.cpp
r122175 r122189 54 54 attributes.premultipliedAlpha = false; 55 55 m_context = GraphicsContext3D::create(attributes, hostWindow, GraphicsContext3D::RenderOffscreen); 56 56 if (!m_context) 57 return; 58 m_context->makeContextCurrent(); 57 59 m_context->enable(GraphicsContext3D::DEPTH_TEST); 58 60 } -
trunk/Source/WebCore/platform/graphics/filters/CustomFilterMesh.cpp
r122175 r122189 246 246 m_bytesPerVertex = generator.floatsPerVertex() * sizeof(float); 247 247 248 m_context->makeContextCurrent(); 249 248 250 m_verticesBufferObject = m_context->createBuffer(); 249 251 m_context->bindBuffer(GraphicsContext3D::ARRAY_BUFFER, m_verticesBufferObject); … … 257 259 CustomFilterMesh::~CustomFilterMesh() 258 260 { 261 m_context->makeContextCurrent(); 259 262 m_context->deleteBuffer(m_verticesBufferObject); 260 263 m_context->deleteBuffer(m_elementsBufferObject); -
trunk/Source/WebCore/platform/graphics/filters/FECustomFilter.cpp
r122175 r122189 104 104 void FECustomFilter::deleteRenderBuffers() 105 105 { 106 if (!m_context) 107 return; 108 m_context->makeContextCurrent(); 106 109 if (m_frameBuffer) { 107 110 m_context->deleteFramebuffer(m_frameBuffer); … … 130 133 IntSize newContextSize(effectDrawingRect.size()); 131 134 bool hadContext = m_context; 132 if (!m_context) 133 initializeContext(); 135 if (!m_context && !initializeContext()) 136 return; 137 m_context->makeContextCurrent(); 134 138 135 139 if (!hadContext || m_contextSize != newContextSize) … … 158 162 } 159 163 160 voidFECustomFilter::initializeContext()164 bool FECustomFilter::initializeContext() 161 165 { 162 166 ASSERT(!m_context.get()); 163 ASSERT(m_globalContext->context());164 167 m_context = m_globalContext->context(); 168 if (!m_context) 169 return false; 170 m_context->makeContextCurrent(); 165 171 166 172 // FIXME: The shader and the mesh can be shared across multiple elements when possible. … … 175 181 FloatRect(0, 0, 1, 1), 176 182 m_meshType); 183 return true; 177 184 } 178 185 -
trunk/Source/WebCore/platform/graphics/filters/FECustomFilter.h
r122175 r122189 73 73 ~FECustomFilter(); 74 74 75 voidinitializeContext();75 bool initializeContext(); 76 76 void deleteRenderBuffers(); 77 77 void resizeContext(const IntSize& newContextSize);
Note: See TracChangeset
for help on using the changeset viewer.