Changeset 93564 in webkit


Ignore:
Timestamp:
Aug 22, 2011 5:14:13 PM (13 years ago)
Author:
nduca@chromium.org
Message:

Make GraphicsContext3D::isResourceSafe a function and, on Chromium, determine its value lazily
https://bugs.webkit.org/show_bug.cgi?id=66708

Reviewed by Kenneth Russell.

Source/WebCore:

  • platform/graphics/GraphicsContext3D.cpp:

(WebCore::GraphicsContext3D::texImage2DResourceSafe):

  • platform/graphics/GraphicsContext3D.h:
  • platform/graphics/gtk/GraphicsContext3DGtk.cpp:

(WebCore::GraphicsContext3D::GraphicsContext3D):

  • platform/graphics/mac/GraphicsContext3DMac.mm:

(WebCore::GraphicsContext3D::GraphicsContext3D):

  • platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:

(WebCore::GraphicsContext3D::isResourceSafe):

  • platform/graphics/qt/GraphicsContext3DQt.cpp:

(WebCore::GraphicsContext3D::GraphicsContext3D):

Source/WebKit/chromium:

  • src/GraphicsContext3DChromium.cpp:

(WebCore::GraphicsContext3DInternal::GraphicsContext3DInternal):
(WebCore::GraphicsContext3DInternal::isResourceSafe):
(WebCore::GraphicsContext3D::create):
(WebCore::GraphicsContext3D::isResourceSafe):

  • src/GraphicsContext3DInternal.h:
Location:
trunk/Source
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r93561 r93564  
     12011-08-22  Nat Duca  <nduca@chromium.org>
     2
     3        Make GraphicsContext3D::isResourceSafe a function and, on Chromium, determine its value lazily
     4        https://bugs.webkit.org/show_bug.cgi?id=66708
     5
     6        Reviewed by Kenneth Russell.
     7
     8        * platform/graphics/GraphicsContext3D.cpp:
     9        (WebCore::GraphicsContext3D::texImage2DResourceSafe):
     10        * platform/graphics/GraphicsContext3D.h:
     11        * platform/graphics/gtk/GraphicsContext3DGtk.cpp:
     12        (WebCore::GraphicsContext3D::GraphicsContext3D):
     13        * platform/graphics/mac/GraphicsContext3DMac.mm:
     14        (WebCore::GraphicsContext3D::GraphicsContext3D):
     15        * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
     16        (WebCore::GraphicsContext3D::isResourceSafe):
     17        * platform/graphics/qt/GraphicsContext3DQt.cpp:
     18        (WebCore::GraphicsContext3D::GraphicsContext3D):
     19
    1202011-08-22  Adam Barth  <abarth@webkit.org>
    221
  • trunk/Source/WebCore/platform/graphics/GraphicsContext3D.cpp

    r86275 r93564  
    6767    ASSERT(unpackAlignment == 1 || unpackAlignment == 2 || unpackAlignment == 4 || unpackAlignment == 8);
    6868    OwnArrayPtr<unsigned char> zero;
    69     if (!m_isResourceSafe && width > 0 && height > 0) {
     69    if (!isResourceSafe() && width > 0 && height > 0) {
    7070        unsigned int size;
    7171        GC3Denum error = computeImageSizeInBytes(format, type, width, height, unpackAlignment, &size, 0);
  • trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h

    r92908 r93564  
    906906
    907907    int m_currentWidth, m_currentHeight;
    908     bool m_isResourceSafe;
     908    bool isResourceSafe();
    909909
    910910#if PLATFORM(MAC)
  • trunk/Source/WebCore/platform/graphics/gtk/GraphicsContext3DGtk.cpp

    r86557 r93564  
    5656    : m_currentWidth(0)
    5757    , m_currentHeight(0)
    58     , m_isResourceSafe(false)
    5958    , m_attrs(attributes)
    6059    , m_texture(0)
  • trunk/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm

    r86275 r93564  
    9191    : m_currentWidth(0)
    9292    , m_currentHeight(0)
    93     , m_isResourceSafe(false)
    9493    , m_contextObj(0)
    9594    , m_attrs(attrs)
  • trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp

    r92908 r93564  
    121121    if (mustRestoreFBO)
    122122        ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO);
     123}
     124
     125bool GraphicsContext3D::isResourceSafe()
     126{
     127    return false;
    123128}
    124129
  • trunk/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp

    r92615 r93564  
    294294    : m_currentWidth(0)
    295295    , m_currentHeight(0)
    296     , m_isResourceSafe(false)
    297296    , m_attrs(attrs)
    298297    , m_texture(0)
  • trunk/Source/WebKit/chromium/ChangeLog

    r93553 r93564  
     12011-08-22  Nat Duca  <nduca@chromium.org>
     2
     3        Make GraphicsContext3D::isResourceSafe a function and, on Chromium, determine its value lazily
     4        https://bugs.webkit.org/show_bug.cgi?id=66708
     5
     6        Reviewed by Kenneth Russell.
     7
     8        * src/GraphicsContext3DChromium.cpp:
     9        (WebCore::GraphicsContext3DInternal::GraphicsContext3DInternal):
     10        (WebCore::GraphicsContext3DInternal::isResourceSafe):
     11        (WebCore::GraphicsContext3D::create):
     12        (WebCore::GraphicsContext3D::isResourceSafe):
     13        * src/GraphicsContext3DInternal.h:
     14
    1152011-08-22  Adam Klein  <adamk@chromium.org>
    216
  • trunk/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp

    r93131 r93564  
    8888    , m_initializedAvailableExtensions(false)
    8989    , m_layerComposited(false)
     90    , m_resourceSafety(ResourceSafetyUnknown)
    9091#if USE(SKIA)
    9192    , m_grContext(0)
     
    759760}
    760761
     762bool GraphicsContext3DInternal::isResourceSafe()
     763{
     764    if (m_resourceSafety == ResourceSafetyUnknown)
     765        m_resourceSafety = getExtensions()->isEnabled("GL_CHROMIUM_resource_safe") ? ResourceSafe : ResourceUnsafe;
     766    return m_resourceSafety == ResourceSafe;
     767}
     768
    761769namespace {
    762770
     
    973981    RefPtr<GraphicsContext3D> result = adoptRef(new GraphicsContext3D(attrs, hostWindow, renderStyle == RenderDirectlyToHostWindow));
    974982    result->m_internal = internal.release();
    975     result->m_isResourceSafe = result->getExtensions()->isEnabled("GL_CHROMIUM_resource_safe");
    976983    return result.release();
    977984}
     
    10021009{
    10031010    return m_internal->getInternalFramebufferSize();
     1011}
     1012
     1013bool GraphicsContext3D::isResourceSafe()
     1014{
     1015    return m_internal->isResourceSafe();
    10041016}
    10051017
  • trunk/Source/WebKit/chromium/src/GraphicsContext3DInternal.h

    r92908 r93564  
    7676    void reshape(int width, int height);
    7777    IntSize getInternalFramebufferSize() const;
     78    bool isResourceSafe();
    7879
    7980    void markContextChanged();
     
    299300    HashSet<String> m_requestableExtensions;
    300301    bool m_layerComposited;
     302
     303    enum ResourceSafety {
     304        ResourceSafetyUnknown,
     305        ResourceSafe,
     306        ResourceUnsafe
     307    };
     308    ResourceSafety m_resourceSafety;
     309
    301310#if USE(ACCELERATED_COMPOSITING)
    302311    RefPtr<WebGLLayerChromium> m_compositingLayer;
Note: See TracChangeset for help on using the changeset viewer.