Changeset 64870 in webkit


Ignore:
Timestamp:
Aug 6, 2010 2:49:20 PM (14 years ago)
Author:
jamesr@google.com
Message:

2010-08-06 James Robinson <jamesr@chromium.org>

Reviewed by Simon Fraser.

Composited canvas should be treated the same by the compositor and not be WebGL specific
https://bugs.webkit.org/show_bug.cgi?id=43589

Initializes the platformLayer as a CanvasLayerChromium, not a WebGLLayerChromium.
The layer itself isn't WebGL-specific.

  • src/GraphicsContext3D.cpp: (WebCore::GraphicsContext3DInternal::initialize): (WebCore::GraphicsContext3DInternal::platformLayer): (WebCore::GraphicsContext3D::platformLayer):

2010-08-06 James Robinson <jamesr@chromium.org>

Reviewed by Simon Fraser.

Composited canvas should be treated the same by the compositor and not be WebGL specific
https://bugs.webkit.org/show_bug.cgi?id=43589

This treats all GraphicsContext3D-backed layers the same instead of special casing WebGL.
The cross-platform change is to rename GraphicsLayer::setContentsToWebGL() to
GraphicsLayer::setContentsToCanvas() and to rename all implementations.

This patch also renames the chromium class used for accelerating these layers.

Cross platform changes:

  • WebCore.gypi:
  • platform/graphics/GraphicsLayer.h: (WebCore::GraphicsLayer::setContentsToCanvas):

Rename the function on the base class. GraphicsLayerCA and GraphicsLayerChromium implement this.

  • rendering/RenderLayerBacking.cpp: (WebCore::isAcceleratedCanvas):

Helper function to see if a renderer is associated with an accelerated compositing layer.

(WebCore::RenderLayerBacking::updateGraphicsLayerConfiguration):
(WebCore::RenderLayerBacking::containsPaintedContent):
(WebCore::RenderLayerBacking::rendererContentChanged):

Chromium specific changes:

  • platform/graphics/chromium/CanvasLayerChromium.cpp: Added. (WebCore::CanvasLayerChromium::create): (WebCore::CanvasLayerChromium::CanvasLayerChromium): (WebCore::CanvasLayerChromium::textureId): (WebCore::CanvasLayerChromium::updateTextureContents): (WebCore::CanvasLayerChromium::setContext):
  • platform/graphics/chromium/CanvasLayerChromium.h: Added. (WebCore::CanvasLayerChromium::drawsContent): (WebCore::CanvasLayerChromium::ownsTexture): (WebCore::CanvasLayerChromium::shaderProgramId): (WebCore::CanvasLayerChromium::setShaderProgramId):
  • platform/graphics/chromium/GraphicsLayerChromium.cpp: (WebCore::GraphicsLayerChromium::setContentsNeedsDisplay): (WebCore::GraphicsLayerChromium::setContentsToCanvas):
  • platform/graphics/chromium/GraphicsLayerChromium.h: (WebCore::GraphicsLayerChromium::):
  • platform/graphics/chromium/LayerRendererChromium.cpp: (WebCore::LayerRendererChromium::drawLayer): (WebCore::LayerRendererChromium::initializeSharedGLObjects):
  • platform/graphics/chromium/LayerRendererChromium.h: (WebCore::LayerRendererChromium::):
  • platform/graphics/chromium/WebGLLayerChromium.cpp: Removed.
  • platform/graphics/chromium/WebGLLayerChromium.h: Removed. Mac specific changes:
  • platform/graphics/mac/GraphicsLayerCA.h: (WebCore::GraphicsLayerCA::):
  • platform/graphics/mac/GraphicsLayerCA.mm: (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): (WebCore::GraphicsLayerCA::updateContentsCanvasLayer): (WebCore::GraphicsLayerCA::setContentsToCanvas):
Location:
trunk
Files:
12 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r64869 r64870  
     12010-08-06  James Robinson  <jamesr@chromium.org>
     2
     3        Reviewed by Simon Fraser.
     4
     5        Composited canvas should be treated the same by the compositor and not be WebGL specific
     6        https://bugs.webkit.org/show_bug.cgi?id=43589
     7
     8        This treats all GraphicsContext3D-backed layers the same instead of special casing WebGL.
     9        The cross-platform change is to rename GraphicsLayer::setContentsToWebGL() to
     10        GraphicsLayer::setContentsToCanvas() and to rename all implementations.
     11
     12        This patch also renames the chromium class used for accelerating these layers.
     13
     14        Cross platform changes:
     15        * WebCore.gypi:
     16        * platform/graphics/GraphicsLayer.h:
     17        (WebCore::GraphicsLayer::setContentsToCanvas):
     18            Rename the function on the base class. GraphicsLayerCA and GraphicsLayerChromium implement this.
     19        * rendering/RenderLayerBacking.cpp:
     20        (WebCore::isAcceleratedCanvas):
     21            Helper function to see if a renderer is associated with an accelerated compositing layer.
     22        (WebCore::RenderLayerBacking::updateGraphicsLayerConfiguration):
     23        (WebCore::RenderLayerBacking::containsPaintedContent):
     24        (WebCore::RenderLayerBacking::rendererContentChanged):
     25       Chromium specific changes:
     26        * platform/graphics/chromium/CanvasLayerChromium.cpp: Added.
     27        (WebCore::CanvasLayerChromium::create):
     28        (WebCore::CanvasLayerChromium::CanvasLayerChromium):
     29        (WebCore::CanvasLayerChromium::textureId):
     30        (WebCore::CanvasLayerChromium::updateTextureContents):
     31        (WebCore::CanvasLayerChromium::setContext):
     32        * platform/graphics/chromium/CanvasLayerChromium.h: Added.
     33        (WebCore::CanvasLayerChromium::drawsContent):
     34        (WebCore::CanvasLayerChromium::ownsTexture):
     35        (WebCore::CanvasLayerChromium::shaderProgramId):
     36        (WebCore::CanvasLayerChromium::setShaderProgramId):
     37        * platform/graphics/chromium/GraphicsLayerChromium.cpp:
     38        (WebCore::GraphicsLayerChromium::setContentsNeedsDisplay):
     39        (WebCore::GraphicsLayerChromium::setContentsToCanvas):
     40        * platform/graphics/chromium/GraphicsLayerChromium.h:
     41        (WebCore::GraphicsLayerChromium::):
     42        * platform/graphics/chromium/LayerRendererChromium.cpp:
     43        (WebCore::LayerRendererChromium::drawLayer):
     44        (WebCore::LayerRendererChromium::initializeSharedGLObjects):
     45        * platform/graphics/chromium/LayerRendererChromium.h:
     46        (WebCore::LayerRendererChromium::):
     47        * platform/graphics/chromium/WebGLLayerChromium.cpp: Removed.
     48        * platform/graphics/chromium/WebGLLayerChromium.h: Removed.
     49        Mac specific changes:
     50        * platform/graphics/mac/GraphicsLayerCA.h:
     51        (WebCore::GraphicsLayerCA::):
     52        * platform/graphics/mac/GraphicsLayerCA.mm:
     53        (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
     54        (WebCore::GraphicsLayerCA::updateContentsCanvasLayer):
     55        (WebCore::GraphicsLayerCA::setContentsToCanvas):
     56
    1572010-08-06  Patrick Gansterer  <paroga@paroga.com>
    258
  • trunk/WebCore/WebCore.gypi

    r64857 r64870  
    21912191            'platform/graphics/cg/PatternCG.cpp',
    21922192            'platform/graphics/cg/TransformationMatrixCG.cpp',
     2193            'platform/graphics/chromium/CanvasLayerChromium.cpp',
     2194            'platform/graphics/chromium/CanvasLayerChromium.h',
    21932195            'platform/graphics/chromium/FontCacheChromiumWin.cpp',
    21942196            'platform/graphics/chromium/FontCacheLinux.cpp',
     
    22382240            'platform/graphics/chromium/VideoLayerChromium.cpp',
    22392241            'platform/graphics/chromium/VideoLayerChromium.h',
    2240             'platform/graphics/chromium/WebGLLayerChromium.cpp',
    2241             'platform/graphics/chromium/WebGLLayerChromium.h',
    22422242            'platform/graphics/filters/FEBlend.cpp',
    22432243            'platform/graphics/filters/FEBlend.h',
  • trunk/WebCore/platform/graphics/GraphicsLayer.h

    r63368 r64870  
    299299    virtual void setContentsToMedia(PlatformLayer*) { } // video or plug-in
    300300    virtual void setContentsBackgroundColor(const Color&) { }
    301 #if ENABLE(3D_CANVAS)
    302     virtual void setContentsToWebGL(PlatformLayer*) { }
    303 #endif
     301    virtual void setContentsToCanvas(PlatformLayer*) { }
    304302    virtual bool hasContentsLayer() const { return false; }
    305303
  • trunk/WebCore/platform/graphics/chromium/CanvasLayerChromium.cpp

    r64869 r64870  
    3333#if USE(ACCELERATED_COMPOSITING)
    3434
    35 #include "WebGLLayerChromium.h"
     35#include "CanvasLayerChromium.h"
    3636
    3737#include "GraphicsContext3D.h"
     
    4040namespace WebCore {
    4141
    42 unsigned WebGLLayerChromium::m_shaderProgramId = 0;
     42unsigned CanvasLayerChromium::m_shaderProgramId = 0;
    4343
    44 PassRefPtr<WebGLLayerChromium> WebGLLayerChromium::create(GraphicsLayerChromium* owner)
     44PassRefPtr<CanvasLayerChromium> CanvasLayerChromium::create(GraphicsLayerChromium* owner)
    4545{
    46     return adoptRef(new WebGLLayerChromium(owner));
     46    return adoptRef(new CanvasLayerChromium(owner));
    4747}
    4848
    49 WebGLLayerChromium::WebGLLayerChromium(GraphicsLayerChromium* owner)
     49CanvasLayerChromium::CanvasLayerChromium(GraphicsLayerChromium* owner)
    5050    : LayerChromium(owner)
    5151    , m_context(0)
     
    5555}
    5656
    57 unsigned WebGLLayerChromium::textureId()
     57unsigned CanvasLayerChromium::textureId()
    5858{
    5959    return m_textureId;
    6060}
    6161
    62 void WebGLLayerChromium::updateTextureContents(unsigned textureId)
     62void CanvasLayerChromium::updateTextureContents(unsigned textureId)
    6363{
    6464    ASSERT(textureId == m_textureId);
     
    8181}
    8282
    83 void WebGLLayerChromium::setContext(const GraphicsContext3D* context)
     83void CanvasLayerChromium::setContext(const GraphicsContext3D* context)
    8484{
    8585    m_context = const_cast<GraphicsContext3D*>(context);
  • trunk/WebCore/platform/graphics/chromium/CanvasLayerChromium.h

    r64869 r64870  
    3030
    3131
    32 #ifndef WebGLLayerChromium_h
    33 #define WebGLLayerChromium_h
     32#ifndef CanvasLayerChromium_h
     33#define CanvasLayerChromium_h
    3434
    3535#if USE(ACCELERATED_COMPOSITING)
     
    4141class GraphicsContext3D;
    4242
    43 // A Layer that contains a WebGL element.
    44 class WebGLLayerChromium : public LayerChromium {
     43// A Layer containing a WebGL or accelerated 2d canvas
     44class CanvasLayerChromium : public LayerChromium {
    4545public:
    46     static PassRefPtr<WebGLLayerChromium> create(GraphicsLayerChromium* owner = 0);
     46    static PassRefPtr<CanvasLayerChromium> create(GraphicsLayerChromium* owner = 0);
    4747    virtual bool drawsContent() { return m_context; }
    4848    virtual bool ownsTexture() { return true; }
     
    5656
    5757private:
    58     WebGLLayerChromium(GraphicsLayerChromium* owner);
     58    explicit CanvasLayerChromium(GraphicsLayerChromium* owner);
    5959    GraphicsContext3D* m_context;
    6060    unsigned m_textureId;
  • trunk/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp

    r64656 r64870  
    5454#include "SystemTime.h"
    5555#include "TransformLayerChromium.h"
    56 #include "WebGLLayerChromium.h"
     56
    5757#include <wtf/CurrentTime.h>
    5858#include <wtf/StringExtras.h>
     
    286286}
    287287
     288void GraphicsLayerChromium::setContentsNeedsDisplay()
     289{
     290    if (m_contentsLayer)
     291        m_contentsLayer->setNeedsDisplay();
     292}
    288293void GraphicsLayerChromium::setNeedsDisplay()
    289294{
     
    335340}
    336341
    337 #if ENABLE(3D_CANVAS)
    338 void GraphicsLayerChromium::setContentsToWebGL(PlatformLayer* platformLayer)
     342void GraphicsLayerChromium::setContentsToCanvas(PlatformLayer* platformLayer)
    339343{
    340344    bool childrenChanged = false;
    341345    if (platformLayer) {
    342         if (!m_contentsLayer.get() || m_contentsLayerPurpose != ContentsLayerForWebGL) {
    343             WebGLLayerChromium* webGLLayer = static_cast<WebGLLayerChromium*>(platformLayer);
    344             setupContentsLayer(webGLLayer);
    345             m_contentsLayer = webGLLayer;
    346             m_contentsLayerPurpose = ContentsLayerForWebGL;
     346        platformLayer->setOwner(this);
     347        if (!m_contentsLayer.get() || m_contentsLayerPurpose != ContentsLayerForCanvas) {
     348            setupContentsLayer(platformLayer);
     349            m_contentsLayer = platformLayer;
     350            m_contentsLayerPurpose = ContentsLayerForCanvas;
    347351            childrenChanged = true;
    348352        }
    349         platformLayer->setOwner(this);
    350353        platformLayer->setNeedsDisplay();
    351354        updateContentsRect();
     
    362365        updateSublayerList();
    363366}
    364 #endif
    365367
    366368void GraphicsLayerChromium::setContentsToMedia(PlatformLayer* layer)
  • trunk/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h

    r63723 r64870  
    8282    virtual void setNeedsDisplay();
    8383    virtual void setNeedsDisplayInRect(const FloatRect&);
     84    virtual void setContentsNeedsDisplay();
    8485
    8586    virtual void setContentsRect(const IntRect&);
     
    8788    virtual void setContentsToImage(Image*);
    8889    virtual void setContentsToMedia(PlatformLayer*);
    89     virtual void setContentsToWebGL(PlatformLayer*);
     90    virtual void setContentsToCanvas(PlatformLayer*);
    9091
    9192    virtual PlatformLayer* platformLayer() const;
     
    138139        ContentsLayerForImage,
    139140        ContentsLayerForVideo,
    140         ContentsLayerForWebGL
     141        ContentsLayerForCanvas
    141142    };
    142143
  • trunk/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp

    r64656 r64870  
    3535#include "LayerRendererChromium.h"
    3636
     37#include "CanvasLayerChromium.h"
    3738#include "GLES2Context.h"
    3839#include "LayerChromium.h"
    3940#include "NotImplemented.h"
    4041#include "TransformLayerChromium.h"
    41 #include "WebGLLayerChromium.h"
    4242#if PLATFORM(SKIA)
    4343#include "NativeImageSkia.h"
     
    692692            // Update the backing texture contents for any dirty portion of the layer.
    693693            layer->updateTextureContents(textureId);
     694            m_gles2Context->makeCurrent();
    694695        }
    695696
     
    771772        "}                                                   \n";
    772773
    773     // WebGL layers need to be flipped vertically and their colors shouldn't be
     774    // Canvas layers need to be flipped vertically and their colors shouldn't be
    774775    // swizzled.
    775     char webGLFragmentShaderString[] =
     776    char canvasFragmentShaderString[] =
    776777        "precision mediump float;                            \n"
    777778        "varying vec2 v_texCoord;                            \n"
     
    820821    LayerChromium::setShaderProgramId(ContentLayerProgram);
    821822
    822     if (!createLayerShader(WebGLLayerProgram, vertexShaderString, webGLFragmentShaderString)) {
    823         LOG_ERROR("Failed to create shader program for WebGL layers");
     823    if (!createLayerShader(CanvasLayerProgram, vertexShaderString, canvasFragmentShaderString)) {
     824        LOG_ERROR("Failed to create shader program for Canvas layers");
    824825        return false;
    825826    }
    826     WebGLLayerChromium::setShaderProgramId(WebGLLayerProgram);
     827    CanvasLayerChromium::setShaderProgramId(CanvasLayerProgram);
    827828
    828829    if (!createLayerShader(ScrollLayerProgram, vertexShaderString, scrollFragmentShaderString)) {
     
    839840    // avoid binding re-binding the vertex attributes.
    840841    bindCommonAttribLocations(ContentLayerProgram);
    841     bindCommonAttribLocations(WebGLLayerProgram);
     842    bindCommonAttribLocations(CanvasLayerProgram);
    842843    bindCommonAttribLocations(DebugBorderProgram);
    843844    bindCommonAttribLocations(ScrollLayerProgram);
  • trunk/WebCore/platform/graphics/chromium/LayerRendererChromium.h

    r64656 r64870  
    8989
    9090private:
    91     enum ShaderProgramType { DebugBorderProgram, ScrollLayerProgram, ContentLayerProgram, WebGLLayerProgram, NumShaderProgramTypes };
     91    enum ShaderProgramType { DebugBorderProgram, ScrollLayerProgram, ContentLayerProgram, CanvasLayerProgram, NumShaderProgramTypes };
    9292
    9393    void updateLayersRecursive(LayerChromium* layer, const TransformationMatrix& parentMatrix, float opacity, const IntRect& visibleRect);
  • trunk/WebCore/platform/graphics/mac/GraphicsLayerCA.h

    r63368 r64870  
    104104    virtual void setContentsToImage(Image*);
    105105    virtual void setContentsToMedia(PlatformLayer*);
    106 #if ENABLE(3D_CANVAS)
    107     virtual void setContentsToWebGL(PlatformLayer*);
    108 #endif
     106    virtual void setContentsToCanvas(PlatformLayer*);
     107
    109108    virtual bool hasContentsLayer() const { return m_contentsLayer; }
    110109   
     
    259258    void updateContentsImage();
    260259    void updateContentsMediaLayer();
    261 #if ENABLE(3D_CANVAS)
    262     void updateContentsWebGLLayer();
    263 #endif
     260    void updateContentsCanvasLayer();
    264261    void updateContentsRect();
    265262    void updateGeometryOrientation();
     
    306303        ContentsImageChanged = 1 << 17,
    307304        ContentsMediaLayerChanged = 1 << 18,
    308 #if ENABLE(3D_CANVAS)
    309         ContentsWebGLLayerChanged = 1 << 19,
    310 #endif
     305        ContentsCanvasLayerChanged = 1 << 19,
    311306        ContentsRectChanged = 1 << 20,
    312307        GeometryOrientationChanged = 1 << 21,
     
    333328        NoContentsLayer = 0,
    334329        ContentsLayerForImage,
    335         ContentsLayerForMedia
    336 #if ENABLE(3D_CANVAS)
    337         , ContentsLayerForWebGL
    338 #endif
     330        ContentsLayerForMedia,
     331        ContentsLayerForCanvas
    339332    };
    340333   
  • trunk/WebCore/platform/graphics/mac/GraphicsLayerCA.mm

    r63835 r64870  
    918918        updateContentsMediaLayer();
    919919   
    920 #if ENABLE(3D_CANVAS)
    921     if (m_uncommittedChanges & ContentsWebGLLayerChanged) // Needs to happen before ChildrenChanged
    922         updateContentsWebGLLayer();
    923 #endif
     920    if (m_uncommittedChanges & ContentsCanvasLayerChanged) // Needs to happen before ChildrenChanged
     921        updateContentsCanvasLayer();
    924922   
    925923    if (m_uncommittedChanges & BackgroundColorChanged)  // Needs to happen before ChildrenChanged, and after updating image or video
     
    13971395}
    13981396
    1399 #if ENABLE(3D_CANVAS)
    1400 void GraphicsLayerCA::updateContentsWebGLLayer()
    1401 {
    1402     // WebGLLayer was set as m_contentsLayer, and will get parented in updateSublayerList().
     1397void GraphicsLayerCA::updateContentsCanvasLayer()
     1398{
     1399    // CanvasLayer was set as m_contentsLayer, and will get parented in updateSublayerList().
    14031400    if (m_contentsLayer) {
    14041401        setupContentsLayer(m_contentsLayer.get());
     
    14071404    }
    14081405}
    1409 #endif
    1410    
     1406
    14111407void GraphicsLayerCA::updateContentsRect()
    14121408{
     
    17231719}
    17241720
    1725 #if ENABLE(3D_CANVAS)
    1726 void GraphicsLayerCA::setContentsToWebGL(PlatformLayer* webglLayer)
    1727 {
    1728     if (webglLayer == m_contentsLayer)
     1721void GraphicsLayerCA::setContentsToCanvas(PlatformLayer* canvasLayer)
     1722{
     1723    if (canvasLayer == m_contentsLayer)
    17291724        return;
    17301725       
    1731     m_contentsLayer = webglLayer;
     1726    m_contentsLayer = canvasLayer;
    17321727    if (m_contentsLayer && [m_contentsLayer.get() respondsToSelector:@selector(setLayerOwner:)])
    17331728        [(id)m_contentsLayer.get() setLayerOwner:this];
    17341729   
    1735     m_contentsLayerPurpose = webglLayer ? ContentsLayerForWebGL : NoContentsLayer;
     1730    m_contentsLayerPurpose = canvasLayer ? ContentsLayerForCanvas : NoContentsLayer;
    17361731
    17371732    noteSublayersChanged();
    1738     noteLayerPropertyChanged(ContentsWebGLLayerChanged);
    1739 }
    1740 #endif
     1733    noteLayerPropertyChanged(ContentsCanvasLayerChanged);
     1734}
    17411735   
    17421736void GraphicsLayerCA::repaintLayerDirtyRects()
  • trunk/WebCore/rendering/RenderLayerBacking.cpp

    r64298 r64870  
    2929
    3030#include "AnimationController.h"
    31 #if ENABLE(3D_CANVAS)   
    32 #include "WebGLRenderingContext.h"
    33 #endif
     31#include "CanvasRenderingContext.h"
    3432#include "CSSPropertyNames.h"
    3533#include "CSSStyleSelector.h"
    3634#include "FrameView.h"
    3735#include "GraphicsContext.h"
     36#include "GraphicsContext3D.h"
    3837#include "GraphicsLayer.h"
    3938#include "HTMLCanvasElement.h"
     
    6766static IntRect clipBox(RenderBox* renderer);
    6867
    69 static inline bool is3DCanvas(RenderObject* renderer)
    70 {
    71 #if ENABLE(3D_CANVAS)   
    72     if (renderer->isCanvas())
    73         return static_cast<HTMLCanvasElement*>(renderer->node())->is3D();
     68static inline bool isAcceleratedCanvas(RenderObject* renderer)
     69{
     70#if ENABLE(3D_CANVAS) || ENABLE(ACCELERATED_2D_CANVAS)
     71    if (renderer->isCanvas()) {
     72        HTMLCanvasElement* canvas = static_cast<HTMLCanvasElement*>(renderer->node());
     73        if (CanvasRenderingContext* context = canvas->renderingContext())
     74            return context->isAccelerated();
     75    }
    7476#else
    7577    UNUSED_PARAM(renderer);
     
    253255    }
    254256#endif
    255 #if ENABLE(3D_CANVAS)    
    256     else if (is3DCanvas(renderer())) {
     257#if ENABLE(3D_CANVAS) || ENABLE(ACCELERATED_2D_CANVAS)
     258    else if (isAcceleratedCanvas(renderer())) {
    257259        HTMLCanvasElement* canvas = static_cast<HTMLCanvasElement*>(renderer()->node());
    258         WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(canvas->renderingContext());
    259         if (context->graphicsContext3D()->platformLayer())
    260             m_graphicsLayer->setContentsToWebGL(context->graphicsContext3D()->platformLayer());
     260        if (CanvasRenderingContext* context = canvas->renderingContext())
     261            if (context->graphicsContext3D())
     262                if (PlatformLayer* pl = context->graphicsContext3D()->platformLayer())
     263                    m_graphicsLayer->setContentsToCanvas(pl);
    261264    }
    262265#endif
     
    757760    // FIXME: we could optimize cases where the image, video or canvas is known to fill the border box entirely,
    758761    // and set background color on the layer in that case, instead of allocating backing store and painting.
    759     if (renderer()->isVideo() || is3DCanvas(renderer()))
     762    if (renderer()->isVideo())
    760763        return hasBoxDecorationsOrBackground(renderer());
     764#if ENABLE(3D_CANVAS) || ENABLE(ACCELERATED_2D_CANVAS)
     765    if (isAcceleratedCanvas(renderer()))
     766        return hasBoxDecorationsOrBackground(renderer());
     767#endif
    761768
    762769    return true;
     
    778785    }
    779786
    780 #if ENABLE(3D_CANVAS)    
    781     if (is3DCanvas(renderer())) {
     787#if ENABLE(3D_CANVAS) || ENABLE(ACCELERATED_2D_CANVAS)
     788    if (isAcceleratedCanvas(renderer())) {
    782789        m_graphicsLayer->setContentsNeedsDisplay();
    783790        return;
  • trunk/WebKit/chromium/ChangeLog

    r64861 r64870  
     12010-08-06  James Robinson  <jamesr@chromium.org>
     2
     3        Reviewed by Simon Fraser.
     4
     5        Composited canvas should be treated the same by the compositor and not be WebGL specific
     6        https://bugs.webkit.org/show_bug.cgi?id=43589
     7
     8        Initializes the platformLayer as a CanvasLayerChromium, not a WebGLLayerChromium.
     9        The layer itself isn't WebGL-specific.
     10
     11        * src/GraphicsContext3D.cpp:
     12        (WebCore::GraphicsContext3DInternal::initialize):
     13        (WebCore::GraphicsContext3DInternal::platformLayer):
     14        (WebCore::GraphicsContext3D::platformLayer):
     15
    1162010-08-06  Jessie Berlin  <jberlin@apple.com>
    217
  • trunk/WebKit/chromium/src/GraphicsContext3D.cpp

    r64767 r64870  
    3636
    3737#include "CachedImage.h"
     38#include "CanvasLayerChromium.h"
    3839#include "CanvasRenderingContext.h"
    3940#include "Chrome.h"
     
    4748#include "Int8Array.h"
    4849#include "Uint8Array.h"
    49 #include "WebGLLayerChromium.h"
    5050#include "WebGraphicsContext3D.h"
    5151#include "WebGraphicsContext3DDefaultImpl.h"
     
    112112
    113113#if USE(ACCELERATED_COMPOSITING)
    114     WebGLLayerChromium* platformLayer() const;
     114    CanvasLayerChromium* platformLayer() const;
    115115#endif
    116116    bool isGLES2Compliant() const;
     
    305305    OwnPtr<WebKit::WebGraphicsContext3D> m_impl;
    306306#if USE(ACCELERATED_COMPOSITING)
    307     RefPtr<WebGLLayerChromium> m_compositingLayer;
     307    RefPtr<CanvasLayerChromium> m_compositingLayer;
    308308#endif
    309309#if PLATFORM(SKIA)
     
    366366
    367367#if USE(ACCELERATED_COMPOSITING)
    368     m_compositingLayer = WebGLLayerChromium::create(0);
     368    m_compositingLayer = CanvasLayerChromium::create(0);
    369369#endif
    370370    return true;
     
    387387
    388388#if USE(ACCELERATED_COMPOSITING)
    389 WebGLLayerChromium* GraphicsContext3DInternal::platformLayer() const
     389CanvasLayerChromium* GraphicsContext3DInternal::platformLayer() const
    390390{
    391391    return m_compositingLayer.get();
     
    10471047PlatformLayer* GraphicsContext3D::platformLayer() const
    10481048{
    1049     WebGLLayerChromium* webGLLayer = m_internal->platformLayer();
    1050     webGLLayer->setContext(this);
    1051     return webGLLayer;
     1049    CanvasLayerChromium* canvasLayer = m_internal->platformLayer();
     1050    canvasLayer->setContext(this);
     1051    return canvasLayer;
    10521052}
    10531053#endif
Note: See TracChangeset for help on using the changeset viewer.