Changeset 84277 in webkit


Ignore:
Timestamp:
Apr 19, 2011 12:03:34 PM (13 years ago)
Author:
senorblanco@chromium.org
Message:

2011-04-19 Stephen White <senorblanco@chromium.org>

Reviewed by Kenneth Russell.

Refactor GLES2Canvas state application out into its own function.
https://bugs.webkit.org/show_bug.cgi?id=58906

Covered by existing tests in fast/canvas and canvas/philip.

  • platform/graphics/chromium/GLES2Canvas.cpp: (WebCore::GLES2Canvas::applyState): New function to apply compositing and clipping state. (WebCore::GLES2Canvas::fillPath): (WebCore::GLES2Canvas::fillRect): (WebCore::GLES2Canvas::beginShadowDraw): (WebCore::GLES2Canvas::endShadowDraw): Refactor calls to applyState().
  • platform/graphics/chromium/GLES2Canvas.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r84273 r84277  
     12011-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
    1202011-04-19  Simon Fraser  <simon.fraser@apple.com>
    221
  • trunk/Source/WebCore/platform/graphics/chromium/GLES2Canvas.cpp

    r83960 r84277  
    236236}
    237237
     238void GLES2Canvas::applyState()
     239{
     240    bindFramebuffer();
     241    m_context->applyCompositeOperator(m_state->m_compositeOp);
     242    applyClipping(m_state->clippingEnabled());
     243}
     244
    238245void GLES2Canvas::scissorClear(float x, float y, float width, float height)
    239246{
     
    257264    }
    258265
    259     bindFramebuffer();
    260     m_context->applyCompositeOperator(m_state->m_compositeOp);
    261     applyClipping(m_state->clippingEnabled());
    262 
     266    applyState();
    263267    fillPathInternal(path, m_state->applyAlpha(m_state->m_fillColor));
    264268}
     
    272276    }
    273277
    274     bindFramebuffer();
    275     m_context->applyCompositeOperator(m_state->m_compositeOp);
    276     applyClipping(m_state->clippingEnabled());
    277 
     278    applyState();
    278279    fillRectInternal(rect, color);
    279280}
     
    778779        m_context->clear(GraphicsContext3D::COLOR_BUFFER_BIT);
    779780    } else {
    780         bindFramebuffer();
    781         m_context->applyCompositeOperator(m_state->m_compositeOp);
    782         applyClipping(m_state->clippingEnabled());
     781        applyState();
    783782    }
    784783}
     
    855854
    856855            // Upsample srcBuffer -> main framebuffer using bicubic filtering.
    857             bindFramebuffer();
    858             m_context->applyCompositeOperator(m_state->m_compositeOp);
    859             applyClipping(m_state->clippingEnabled());
     856            applyState();
    860857            m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, srcBuffer->colorBuffer());
    861858            FloatRect dstRect = srcRect;
     
    864861        } else {
    865862            // Blur in Y directly to framebuffer.
    866             bindFramebuffer();
    867             m_context->applyCompositeOperator(m_state->m_compositeOp);
    868             applyClipping(m_state->clippingEnabled());
    869 
     863            applyState();
    870864            convolveRect(srcBuffer->colorBuffer(), srcBuffer->size(), flipRect(srcRect), srcRect, imageIncrementY, kernel.get(), kernelWidth);
    871865        }
  • trunk/Source/WebCore/platform/graphics/chromium/GLES2Canvas.h

    r83960 r84277  
    101101
    102102private:
     103    void applyState();
    103104    void scissorClear(float x, float y, float width, float height);
    104105    void drawTexturedRectTile(Texture* texture, int tile, const FloatRect& srcRect, const FloatRect& dstRect, const AffineTransform&, float alpha);
     
    107108    void convolveRect(unsigned texture, const IntSize& textureSize, const FloatRect& srcRect, const FloatRect& dstRect, float imageIncrement[2], const float* kernel, int kernelWidth);
    108109
    109     void applyCompositeOperator(CompositeOperator);
    110110    void tesselateAndFillPath(const Path&, const Color&);
    111111    void fillPathInternal(const Path&, const Color&);
Note: See TracChangeset for help on using the changeset viewer.