- a/Source/WebCore/ChangeLog +18 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2012-12-20  Sheriff Bot  <webkit.review.bot@gmail.com>
2
3
        Unreviewed, rolling out r138265.
4
        http://trac.webkit.org/changeset/138265
5
        https://bugs.webkit.org/show_bug.cgi?id=105586
6
7
        Accidentally committed extra code that is not reviewed and
8
        shouldn't go with this commit. (Requested by ostap on
9
        #webkit).
10
11
        * platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp:
12
        (WebCore::GraphicsSurfacePrivate::GraphicsSurfacePrivate):
13
        (WebCore::GraphicsSurfacePrivate::createPixmap):
14
        (GraphicsSurfacePrivate):
15
        (WebCore::GraphicsSurface::platformSwapBuffers):
16
        * platform/graphics/texmap/TextureMapperBackingStore.cpp:
17
        (WebCore::TextureMapperSurfaceBackingStore::swapBuffersIfNeeded):
18
1
2012-12-20  Ryosuke Niwa  <rniwa@webkit.org>
19
2012-12-20  Ryosuke Niwa  <rniwa@webkit.org>
2
20
3
        REGRESSION(r133820?): SimplifyMarkupTest API test asserts
21
        REGRESSION(r133820?): SimplifyMarkupTest API test asserts
- a/Source/WebCore/platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp -32 / +12 lines
Lines 168-174 struct GraphicsSurfacePrivate { a/Source/WebCore/platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp_sec1
168
        GLXFBConfig* fbConfigs = glXChooseFBConfig(m_display, DefaultScreen(m_display), attributes, &numReturned);
168
        GLXFBConfig* fbConfigs = glXChooseFBConfig(m_display, DefaultScreen(m_display), attributes, &numReturned);
169
169
170
        // Make sure that we choose a configuration that supports an alpha mask.
170
        // Make sure that we choose a configuration that supports an alpha mask.
171
        m_fbConfig = findFBConfigWithAlpha(fbConfigs, numReturned);
171
        for (int i = 0; i < numReturned; ++i) {
172
            XVisualInfo* visualInfo = glXGetVisualFromFBConfig(m_display, fbConfigs[i]);
173
            if (!visualInfo)
174
                continue;
175
176
            XRenderPictFormat* format = XRenderFindVisualFormat(m_display, visualInfo->visual);
177
            if (format && format->direct.alphaMask > 0) {
178
                m_fbConfig = fbConfigs[i];
179
                break;
180
            }
181
        }
172
182
173
        XFree(fbConfigs);
183
        XFree(fbConfigs);
174
184
Lines 245-255 struct GraphicsSurfacePrivate { a/Source/WebCore/platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp_sec2
245
        int numberOfConfigs;
255
        int numberOfConfigs;
246
        GLXFBConfig* configs = glXChooseFBConfig(m_display, XDefaultScreen(m_display), glxSpec, &numberOfConfigs);
256
        GLXFBConfig* configs = glXChooseFBConfig(m_display, XDefaultScreen(m_display), glxSpec, &numberOfConfigs);
247
257
248
        // If origin window has alpha then try to find config with alpha.
249
        GLXFBConfig& config = m_hasAlpha ? findFBConfigWithAlpha(configs, numberOfConfigs) : configs[0];
250
251
        m_xPixmap = XCompositeNameWindowPixmap(m_display, winId);
258
        m_xPixmap = XCompositeNameWindowPixmap(m_display, winId);
252
        m_glxPixmap = glXCreatePixmap(m_display, config, m_xPixmap, glxAttributes);
259
        m_glxPixmap = glXCreatePixmap(m_display, *configs, m_xPixmap, glxAttributes);
253
260
254
        uint inverted = 0;
261
        uint inverted = 0;
255
        glXQueryDrawable(m_display, m_glxPixmap, GLX_Y_INVERTED_EXT, &inverted);
262
        glXQueryDrawable(m_display, m_glxPixmap, GLX_Y_INVERTED_EXT, &inverted);
Lines 347-372 struct GraphicsSurfacePrivate { a/Source/WebCore/platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp_sec3
347
        return m_size;
354
        return m_size;
348
    }
355
    }
349
356
350
    bool isReceiver() const { return m_isReceiver; }
351
private:
357
private:
352
    GLXFBConfig& findFBConfigWithAlpha(GLXFBConfig* fbConfigs, int numberOfConfigs)
353
    {
354
        for (int i = 0; i < numberOfConfigs; ++i) {
355
            XVisualInfo* visualInfo = glXGetVisualFromFBConfig(m_display, fbConfigs[i]);
356
            if (!visualInfo)
357
                continue;
358
359
            XRenderPictFormat* format = XRenderFindVisualFormat(m_display, visualInfo->visual);
360
            if (format && format->direct.alphaMask > 0) {
361
                return fbConfigs[i];
362
                break;
363
            }
364
        }
365
366
        // Return 1st config as a fallback.
367
        return fbConfigs[0];
368
    }
369
370
    OffScreenRootWindow m_offScreenWindow;
358
    OffScreenRootWindow m_offScreenWindow;
371
    IntSize m_size;
359
    IntSize m_size;
372
    Display* m_display;
360
    Display* m_display;
Lines 449-462 uint32_t GraphicsSurface::platformFrontBuffer() const a/Source/WebCore/platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp_sec4
449
437
450
uint32_t GraphicsSurface::platformSwapBuffers()
438
uint32_t GraphicsSurface::platformSwapBuffers()
451
{
439
{
452
    if (m_private->isReceiver()) {
453
        glBindTexture(GL_TEXTURE_2D, platformGetTextureID());
454
        // Release previous lock and rebind texture to surface to get frame update.
455
        pGlXReleaseTexImageEXT(m_private->display(), m_private->glxPixmap(), GLX_FRONT_EXT);
456
        pGlXBindTexImageEXT(m_private->display(), m_private->glxPixmap(), GLX_FRONT_EXT, 0);
457
        return 0;
458
    }
459
460
    m_private->swapBuffers();
440
    m_private->swapBuffers();
461
    return 0;
441
    return 0;
462
}
442
}
- a/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.cpp -2 / +2 lines
Lines 39-47 void TextureMapperSurfaceBackingStore::setGraphicsSurface(PassRefPtr<GraphicsSur a/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.cpp_sec1
39
    m_graphicsSurface = surface;
39
    m_graphicsSurface = surface;
40
}
40
}
41
41
42
void TextureMapperSurfaceBackingStore::swapBuffersIfNeeded(uint32_t)
42
void TextureMapperSurfaceBackingStore::swapBuffersIfNeeded(uint32_t frontBuffer)
43
{
43
{
44
    if (m_graphicsSurface)
44
    if (m_graphicsSurface && m_graphicsSurface->frontBuffer() != frontBuffer)
45
        m_graphicsSurface->swapBuffers();
45
        m_graphicsSurface->swapBuffers();
46
}
46
}
47
47

Return to Bug 105586