Changeset 112407 in webkit


Ignore:
Timestamp:
Mar 28, 2012 9:03:29 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[BlackBerry] Plumb through GraphicsLayer::contentsOpaque() to LayerTiler
https://bugs.webkit.org/show_bug.cgi?id=82457

Patch by Arvid Nilsson <anilsson@rim.com> on 2012-03-28
Reviewed by Rob Buis.

The LayerTiler already knows not to turn on GL_BLEND for opaque layers.
However, it only ever sets the opaque flag for image layers and color
layers, never for content layers.

This was no big deal, because contentsOpaque() is currently false for
all layers except the root layer, which we always drew using the
BlackBerry::WebKit::BackingStore anyway.

When we start using RenderLayerBacking::m_usingTiledCacheLayer=true on
the root layer in situations where the BackingStore is unavailable, we
can speed up rendering of the root layer by honouring the opaque flag.

Fixed by plumbing through the GraphicsLayer::contentsOpaque() flag all
the way to LayerTiler and on to Texture.

  • platform/graphics/blackberry/LayerData.h:

(WebCore::LayerData::LayerData):
(WebCore::LayerData::isOpaque):
(LayerData):

  • platform/graphics/blackberry/LayerTile.cpp:

(WebCore::LayerTile::updateContents):

  • platform/graphics/blackberry/LayerTile.h:

(LayerTile):

  • platform/graphics/blackberry/LayerTiler.cpp:

(WebCore::LayerTiler::updateTextureContentsIfNeeded):
(WebCore::LayerTiler::performTileJob):

  • platform/graphics/blackberry/LayerTiler.h:

(WebCore::LayerTiler::TextureJob::TextureJob):
(WebCore::LayerTiler::TextureJob::updateContents):

  • platform/graphics/blackberry/LayerWebKitThread.h:

(WebCore::LayerWebKitThread::setOpaque):

  • platform/graphics/blackberry/Texture.h:

(Texture):

  • platform/graphics/blackberry/TextureCacheCompositingThread.cpp:

(WebCore::TextureCacheCompositingThread::updateContents):

  • platform/graphics/blackberry/TextureCacheCompositingThread.h:

(TextureCacheCompositingThread):

Location:
trunk/Source/WebCore
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r112403 r112407  
     12012-03-28  Arvid Nilsson  <anilsson@rim.com>
     2
     3        [BlackBerry] Plumb through GraphicsLayer::contentsOpaque() to LayerTiler
     4        https://bugs.webkit.org/show_bug.cgi?id=82457
     5
     6        Reviewed by Rob Buis.
     7
     8        The LayerTiler already knows not to turn on GL_BLEND for opaque layers.
     9        However, it only ever sets the opaque flag for image layers and color
     10        layers, never for content layers.
     11
     12        This was no big deal, because contentsOpaque() is currently false for
     13        all layers except the root layer, which we always drew using the
     14        BlackBerry::WebKit::BackingStore anyway.
     15
     16        When we start using RenderLayerBacking::m_usingTiledCacheLayer=true on
     17        the root layer in situations where the BackingStore is unavailable, we
     18        can speed up rendering of the root layer by honouring the opaque flag.
     19
     20        Fixed by plumbing through the GraphicsLayer::contentsOpaque() flag all
     21        the way to LayerTiler and on to Texture.
     22
     23        * platform/graphics/blackberry/LayerData.h:
     24        (WebCore::LayerData::LayerData):
     25        (WebCore::LayerData::isOpaque):
     26        (LayerData):
     27        * platform/graphics/blackberry/LayerTile.cpp:
     28        (WebCore::LayerTile::updateContents):
     29        * platform/graphics/blackberry/LayerTile.h:
     30        (LayerTile):
     31        * platform/graphics/blackberry/LayerTiler.cpp:
     32        (WebCore::LayerTiler::updateTextureContentsIfNeeded):
     33        (WebCore::LayerTiler::performTileJob):
     34        * platform/graphics/blackberry/LayerTiler.h:
     35        (WebCore::LayerTiler::TextureJob::TextureJob):
     36        (WebCore::LayerTiler::TextureJob::updateContents):
     37        * platform/graphics/blackberry/LayerWebKitThread.h:
     38        (WebCore::LayerWebKitThread::setOpaque):
     39        * platform/graphics/blackberry/Texture.h:
     40        (Texture):
     41        * platform/graphics/blackberry/TextureCacheCompositingThread.cpp:
     42        (WebCore::TextureCacheCompositingThread::updateContents):
     43        * platform/graphics/blackberry/TextureCacheCompositingThread.h:
     44        (TextureCacheCompositingThread):
     45
    1462012-03-28  Andrey Kosyakov  <caseq@chromium.org>
    247
  • trunk/Source/WebCore/platform/graphics/blackberry/LayerData.h

    r112124 r112407  
    7979        , m_doubleSided(true)
    8080        , m_masksToBounds(false)
    81         , m_opaque(true)
     81        , m_isOpaque(false)
    8282        , m_preserves3D(false)
    8383        , m_needsDisplayOnBoundsChange(false)
     
    114114    float opacity() const { return m_opacity; }
    115115
    116     bool opaque() const { return m_opaque; }
     116    bool isOpaque() const { return m_isOpaque; }
    117117
    118118    FloatPoint position() const { return m_position; }
     
    198198    unsigned m_doubleSided : 1;
    199199    unsigned m_masksToBounds : 1;
    200     unsigned m_opaque : 1;
     200    unsigned m_isOpaque : 1;
    201201    unsigned m_preserves3D : 1;
    202202    unsigned m_needsDisplayOnBoundsChange : 1;
  • trunk/Source/WebCore/platform/graphics/blackberry/LayerTile.cpp

    r110300 r112407  
    4848}
    4949
    50 void LayerTile::updateContents(const SkBitmap& contents, const IntRect& dirtyRect, const IntRect& tileRect)
     50void LayerTile::updateContents(const SkBitmap& contents, const IntRect& dirtyRect, const IntRect& tileRect, bool isOpaque)
    5151{
    52     setTexture(textureCacheCompositingThread()->updateContents(m_texture, contents, dirtyRect, tileRect));
     52    setTexture(textureCacheCompositingThread()->updateContents(m_texture, contents, dirtyRect, tileRect, isOpaque));
    5353}
    5454
  • trunk/Source/WebCore/platform/graphics/blackberry/LayerTile.h

    r110300 r112407  
    6464    void setContents(const SkBitmap& contents, const IntRect& tileRect, const TileIndex&, bool isOpaque);
    6565    void setContentsToColor(const Color&);
    66     void updateContents(const SkBitmap& contents, const IntRect& dirtyRect, const IntRect& tileRect);
     66    void updateContents(const SkBitmap& contents, const IntRect& dirtyRect, const IntRect& tileRect, bool isOpaque);
    6767    void discardContents();
    6868
  • trunk/Source/WebCore/platform/graphics/blackberry/LayerTiler.cpp

    r112124 r112407  
    203203                        addTextureJob(TextureJob::setContentsToColor(color, *it));
    204204                    else
    205                         addTextureJob(TextureJob::updateContents(bitmap, tileRect));
     205                        addTextureJob(TextureJob::updateContents(bitmap, tileRect, m_layer->isOpaque()));
    206206                }
    207207
     
    298298                    addTextureJob(TextureJob::setContentsToColor(color, index));
    299299                else
    300                     addTextureJob(TextureJob::updateContents(bitmap, tileRect));
     300                    addTextureJob(TextureJob::updateContents(bitmap, tileRect, m_layer->isOpaque()));
    301301            }
    302302        }
     
    453453        return;
    454454    case TextureJob::UpdateContents:
    455         tile->updateContents(job.m_contents, job.m_dirtyRect, tileRect);
     455        tile->updateContents(job.m_contents, job.m_dirtyRect, tileRect, job.m_isOpaque);
    456456        return;
    457457    case TextureJob::DiscardContents:
  • trunk/Source/WebCore/platform/graphics/blackberry/LayerTiler.h

    r110300 r112407  
    101101        }
    102102
    103         TextureJob(Type type, const SkBitmap& contents, const IntRect& dirtyRect, bool isOpaque = false)
     103        TextureJob(Type type, const SkBitmap& contents, const IntRect& dirtyRect, bool isOpaque)
    104104            : m_type(type)
    105105            , m_contents(contents)
     
    122122        static TextureJob setContents(const SkBitmap& contents, bool isOpaque) { return TextureJob(SetContents, contents, IntRect(IntPoint::zero(), IntSize(contents.width(), contents.height())), isOpaque); }
    123123        static TextureJob setContentsToColor(const Color& color, const TileIndex& index) { return TextureJob(SetContentsToColor, color, index); }
    124         static TextureJob updateContents(const SkBitmap& contents, const IntRect& dirtyRect) { return TextureJob(UpdateContents, contents, dirtyRect); }
     124        static TextureJob updateContents(const SkBitmap& contents, const IntRect& dirtyRect, bool isOpaque) { return TextureJob(UpdateContents, contents, dirtyRect, isOpaque); }
    125125        static TextureJob discardContents(const IntRect& dirtyRect) { return TextureJob(DiscardContents, dirtyRect); }
    126126        static TextureJob resizeContents(const IntSize& newSize) { return TextureJob(ResizeContents, newSize); }
  • trunk/Source/WebCore/platform/graphics/blackberry/LayerWebKitThread.h

    r109668 r112407  
    9696    void setOpacity(float opacity) { m_opacity = opacity; setNeedsCommit(); }
    9797
    98     void setOpaque(bool opaque) { m_opaque = opaque; setNeedsCommit(); }
     98    void setOpaque(bool isOpaque) { m_isOpaque = isOpaque; setNeedsCommit(); }
    9999
    100100    void setPosition(const FloatPoint& position) { m_position = position; setNeedsCommit(); }
  • trunk/Source/WebCore/platform/graphics/blackberry/Texture.h

    r110040 r112407  
    6262    bool protect(const IntSize&);
    6363
    64     void updateContents(const SkBitmap& contents, const IntRect& dirtyRect, const IntRect& tile, bool isOpaque = false);
     64    void updateContents(const SkBitmap& contents, const IntRect& dirtyRect, const IntRect& tile, bool isOpaque);
    6565    void setContentsToColor(const Color&);
    6666
  • trunk/Source/WebCore/platform/graphics/blackberry/TextureCacheCompositingThread.cpp

    r110040 r112407  
    255255}
    256256
    257 PassRefPtr<Texture> TextureCacheCompositingThread::updateContents(const RefPtr<Texture>& textureIn, const SkBitmap& contents, const IntRect& dirtyRect, const IntRect& tileRect)
     257PassRefPtr<Texture> TextureCacheCompositingThread::updateContents(const RefPtr<Texture>& textureIn, const SkBitmap& contents, const IntRect& dirtyRect, const IntRect& tileRect, bool isOpaque)
    258258{
    259259    RefPtr<Texture> texture(textureIn);
     
    267267    TextureProtector protector(texture.get());
    268268
    269     texture->updateContents(contents, dirtyRect, tileRect);
     269    texture->updateContents(contents, dirtyRect, tileRect, isOpaque);
    270270
    271271    return texture.release();
  • trunk/Source/WebCore/platform/graphics/blackberry/TextureCacheCompositingThread.h

    r110040 r112407  
    5555
    5656    // Update contents of an existing texture, or create a new one if texture is 0.
    57     PassRefPtr<Texture> updateContents(const RefPtr<Texture>&, const SkBitmap& contents, const IntRect& dirtyRect, const IntRect& tileRect);
     57    PassRefPtr<Texture> updateContents(const RefPtr<Texture>&, const SkBitmap& contents, const IntRect& dirtyRect, const IntRect& tileRect, bool isOpaque);
    5858
    5959    size_t memoryUsage() const { return m_memoryUsage; }
Note: See TracChangeset for help on using the changeset viewer.