Changeset 69793 in webkit


Ignore:
Timestamp:
Oct 14, 2010 12:29:25 PM (14 years ago)
Author:
commit-queue@webkit.org
Message:

2010-10-14 Xan Lopez <xlopez@igalia.com>

Reviewed by Martin Robinson.

[GTK] Small cleanup in PluginViewGtk
https://bugs.webkit.org/show_bug.cgi?id=47588

Remove some dead code and use PlatformRefPtr for cairo surfaces.

No new tests, only refactoring.

  • plugins/gtk/PluginViewGtk.cpp: (WebCore::PluginView::paint):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r69791 r69793  
     12010-10-14  Xan Lopez  <xlopez@igalia.com>
     2
     3        Reviewed by Martin Robinson.
     4
     5        [GTK] Small cleanup in PluginViewGtk
     6        https://bugs.webkit.org/show_bug.cgi?id=47588
     7
     8        Remove some dead code and use PlatformRefPtr for cairo surfaces.
     9
     10        No new tests, only refactoring.
     11
     12        * plugins/gtk/PluginViewGtk.cpp:
     13        (WebCore::PluginView::paint):
     14
    1152010-10-14  Dawit Alemayehu  <adawit@kde.org>
    216
  • trunk/WebCore/plugins/gtk/PluginViewGtk.cpp

    r69344 r69793  
    194194    exposedRect.move(-frameRect().x(), -frameRect().y());
    195195
    196     Window dummyW;
    197     int dummyI;
    198     unsigned int dummyUI, actualDepth = 0;
    199     XGetGeometry(GDK_DISPLAY(), m_drawable, &dummyW, &dummyI, &dummyI,
    200                  &dummyUI, &dummyUI, &dummyUI, &actualDepth);
    201 
    202     const unsigned int drawableDepth = ((NPSetWindowCallbackStruct*)m_npWindow.ws_info)->depth;
    203     ASSERT(drawableDepth == actualDepth);
    204 
    205     cairo_surface_t* drawableSurface = cairo_xlib_surface_create(GDK_DISPLAY(),
    206                                                                  m_drawable,
    207                                                                  m_visual,
    208                                                                  m_windowRect.width(),
    209                                                                  m_windowRect.height());
     196    PlatformRefPtr<cairo_surface_t> drawableSurface = adoptPlatformRef(cairo_xlib_surface_create(GDK_DISPLAY(),
     197                                                                                                 m_drawable,
     198                                                                                                 m_visual,
     199                                                                                                 m_windowRect.width(),
     200                                                                                                 m_windowRect.height()));
    210201
    211202    if (m_isTransparent) {
     
    214205        // we'd end up with junk in there from the last paint, or, worse,
    215206        // uninitialized data.
    216         PlatformRefPtr<cairo_t> cr = adoptPlatformRef(cairo_create(drawableSurface));
    217 
    218         if (!(cairo_surface_get_content(drawableSurface) & CAIRO_CONTENT_ALPHA)) {
     207        PlatformRefPtr<cairo_t> cr = adoptPlatformRef(cairo_create(drawableSurface.get()));
     208
     209        if (!(cairo_surface_get_content(drawableSurface.get()) & CAIRO_CONTENT_ALPHA)) {
    219210            // Attempt to fake it when we don't have an alpha channel on our
    220211            // pixmap.  If that's not possible, at least clear the window to
     
    252243    cairo_save(cr);
    253244
    254     cairo_set_source_surface(cr, drawableSurface, frameRect().x(), frameRect().y());
     245    cairo_set_source_surface(cr, drawableSurface.get(), frameRect().x(), frameRect().y());
    255246
    256247    cairo_rectangle(cr,
     
    266257
    267258    cairo_restore(cr);
    268     cairo_surface_destroy(drawableSurface);
    269259#endif // defined(XP_UNIX)
    270260}
Note: See TracChangeset for help on using the changeset viewer.