Changeset 206070 in webkit


Ignore:
Timestamp:
Sep 17, 2016 3:50:07 AM (8 years ago)
Author:
Carlos Garcia Campos
Message:

Merge r206045 - [GTK] Surface created for glReadPixels path on Wayland is bigger than needed
https://bugs.webkit.org/show_bug.cgi?id=162025

Reviewed by Carlos Garcia Campos.

  • UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:

(WebKit::AcceleratedBackingStoreWayland::paint): the texture created by the Wayland
compositor is already scaled, so scaling its size when creating the surface causes it
to end up bigger than necessary.

Location:
releases/WebKitGTK/webkit-2.14/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.14/Source/WebKit2/ChangeLog

    r205962 r206070  
     12016-09-15  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
     2
     3        [GTK] Surface created for glReadPixels path on Wayland is bigger than needed
     4        https://bugs.webkit.org/show_bug.cgi?id=162025
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
     9        (WebKit::AcceleratedBackingStoreWayland::paint): the texture created by the Wayland
     10        compositor is already scaled, so scaling its size when creating the surface causes it
     11        to end up bigger than necessary.
     12
    1132016-09-15  Carlos Garcia Campos  <cgarcia@igalia.com>
    214
  • releases/WebKitGTK/webkit-2.14/Source/WebKit2/UIProcess/gtk/AcceleratedBackingStoreWayland.cpp

    r205700 r206070  
    7676    gdk_cairo_draw_from_gl(cr, gtk_widget_get_window(m_webPage.viewWidget()), texture, GL_TEXTURE, 1, clipRect.x(), clipRect.y(), clipRect.width(), clipRect.height());
    7777#else
    78     IntSize size = textureSize;
    79     float deviceScaleFactor = m_webPage.deviceScaleFactor();
    80     size.scale(deviceScaleFactor);
     78    if (!m_surface || cairo_image_surface_get_width(m_surface.get()) != textureSize.width() || cairo_image_surface_get_height(m_surface.get()) != textureSize.height())
     79        m_surface = adoptRef(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, textureSize.width(), textureSize.height()));
    8180
    82     if (!m_surface || cairo_image_surface_get_width(m_surface.get()) != size.width() || cairo_image_surface_get_height(m_surface.get()) != size.height())
    83         m_surface = adoptRef(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, size.width(), size.height()));
    84     cairoSurfaceSetDeviceScale(m_surface.get(), deviceScaleFactor, deviceScaleFactor);
     81    cairoSurfaceSetDeviceScale(m_surface.get(), m_webPage.deviceScaleFactor(), m_webPage.deviceScaleFactor());
    8582
    8683    GLuint fb;
     
    104101
    105102    // Convert to BGRA.
    106     int totalBytes = size.width() * size.height() * 4;
     103    int totalBytes = textureSize.width() * textureSize.height() * 4;
    107104    for (int i = 0; i < totalBytes; i += 4)
    108105        std::swap(data[i], data[i + 2]);
Note: See TracChangeset for help on using the changeset viewer.