Changeset 84277 in webkit
- Timestamp:
- Apr 19, 2011 12:03:34 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r84273 r84277 1 2011-04-19 Stephen White <senorblanco@chromium.org> 2 3 Reviewed by Kenneth Russell. 4 5 Refactor GLES2Canvas state application out into its own function. 6 https://bugs.webkit.org/show_bug.cgi?id=58906 7 8 Covered by existing tests in fast/canvas and canvas/philip. 9 10 * platform/graphics/chromium/GLES2Canvas.cpp: 11 (WebCore::GLES2Canvas::applyState): 12 New function to apply compositing and clipping state. 13 (WebCore::GLES2Canvas::fillPath): 14 (WebCore::GLES2Canvas::fillRect): 15 (WebCore::GLES2Canvas::beginShadowDraw): 16 (WebCore::GLES2Canvas::endShadowDraw): 17 Refactor calls to applyState(). 18 * platform/graphics/chromium/GLES2Canvas.h: 19 1 20 2011-04-19 Simon Fraser <simon.fraser@apple.com> 2 21 -
trunk/Source/WebCore/platform/graphics/chromium/GLES2Canvas.cpp
r83960 r84277 236 236 } 237 237 238 void GLES2Canvas::applyState() 239 { 240 bindFramebuffer(); 241 m_context->applyCompositeOperator(m_state->m_compositeOp); 242 applyClipping(m_state->clippingEnabled()); 243 } 244 238 245 void GLES2Canvas::scissorClear(float x, float y, float width, float height) 239 246 { … … 257 264 } 258 265 259 bindFramebuffer(); 260 m_context->applyCompositeOperator(m_state->m_compositeOp); 261 applyClipping(m_state->clippingEnabled()); 262 266 applyState(); 263 267 fillPathInternal(path, m_state->applyAlpha(m_state->m_fillColor)); 264 268 } … … 272 276 } 273 277 274 bindFramebuffer(); 275 m_context->applyCompositeOperator(m_state->m_compositeOp); 276 applyClipping(m_state->clippingEnabled()); 277 278 applyState(); 278 279 fillRectInternal(rect, color); 279 280 } … … 778 779 m_context->clear(GraphicsContext3D::COLOR_BUFFER_BIT); 779 780 } else { 780 bindFramebuffer(); 781 m_context->applyCompositeOperator(m_state->m_compositeOp); 782 applyClipping(m_state->clippingEnabled()); 781 applyState(); 783 782 } 784 783 } … … 855 854 856 855 // Upsample srcBuffer -> main framebuffer using bicubic filtering. 857 bindFramebuffer(); 858 m_context->applyCompositeOperator(m_state->m_compositeOp); 859 applyClipping(m_state->clippingEnabled()); 856 applyState(); 860 857 m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, srcBuffer->colorBuffer()); 861 858 FloatRect dstRect = srcRect; … … 864 861 } else { 865 862 // Blur in Y directly to framebuffer. 866 bindFramebuffer(); 867 m_context->applyCompositeOperator(m_state->m_compositeOp); 868 applyClipping(m_state->clippingEnabled()); 869 863 applyState(); 870 864 convolveRect(srcBuffer->colorBuffer(), srcBuffer->size(), flipRect(srcRect), srcRect, imageIncrementY, kernel.get(), kernelWidth); 871 865 } -
trunk/Source/WebCore/platform/graphics/chromium/GLES2Canvas.h
r83960 r84277 101 101 102 102 private: 103 void applyState(); 103 104 void scissorClear(float x, float y, float width, float height); 104 105 void drawTexturedRectTile(Texture* texture, int tile, const FloatRect& srcRect, const FloatRect& dstRect, const AffineTransform&, float alpha); … … 107 108 void convolveRect(unsigned texture, const IntSize& textureSize, const FloatRect& srcRect, const FloatRect& dstRect, float imageIncrement[2], const float* kernel, int kernelWidth); 108 109 109 void applyCompositeOperator(CompositeOperator);110 110 void tesselateAndFillPath(const Path&, const Color&); 111 111 void fillPathInternal(const Path&, const Color&);
Note: See TracChangeset
for help on using the changeset viewer.