Skip to content

Commit

Permalink
Merge r221183 - [GTK] Completely garbled display in Transifex in acce…
Browse files Browse the repository at this point in the history
…lerated compositing mode

https://bugs.webkit.org/show_bug.cgi?id=174632

Reviewed by Michael Catanzaro.

Remove the copy constructor from PlatformContextCairo::State. This is because it will be used by WTF::Vector
to copy the instances around when allocating new memory, but it doesn't copy the m_imageMaskInformation
attribute, so it will be lost when the Vector reallocates its contents. When this happens, renderings that use
GraphicsContext::clipToImageBuffer() fail to render properly.

Covered by existent tests.

* platform/graphics/cairo/PlatformContextCairo.cpp:
(WebCore::PlatformContextCairo::State::State):
(WebCore::PlatformContextCairo::save):
  • Loading branch information
magomez authored and carlosgcampos committed Aug 30, 2017
1 parent 08ddd1f commit 35aed2f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
18 changes: 18 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,21 @@
2017-08-25 Miguel Gomez <magomez@igalia.com>

[GTK] Completely garbled display in Transifex in accelerated compositing mode
https://bugs.webkit.org/show_bug.cgi?id=174632

Reviewed by Michael Catanzaro.

Remove the copy constructor from PlatformContextCairo::State. This is because it will be used by WTF::Vector
to copy the instances around when allocating new memory, but it doesn't copy the m_imageMaskInformation
attribute, so it will be lost when the Vector reallocates its contents. When this happens, renderings that use
GraphicsContext::clipToImageBuffer() fail to render properly.

Covered by existent tests.

* platform/graphics/cairo/PlatformContextCairo.cpp:
(WebCore::PlatformContextCairo::State::State):
(WebCore::PlatformContextCairo::save):

2017-08-24 Alex Christensen <achristensen@webkit.org>

Stop using PolicyCallback for new window policies
Expand Down
Expand Up @@ -68,9 +68,9 @@ class PlatformContextCairo::State {
{
}

State(const State& state)
: m_globalAlpha(state.m_globalAlpha)
, m_imageInterpolationQuality(state.m_imageInterpolationQuality)
State(float globalAlpha, InterpolationQuality imageInterpolationQuality)
: m_globalAlpha(globalAlpha)
, m_imageInterpolationQuality(imageInterpolationQuality)
{
// We do not copy m_imageMaskInformation because otherwise it would be applied
// more than once during subsequent calls to restore().
Expand Down Expand Up @@ -110,7 +110,7 @@ PlatformContextCairo::~PlatformContextCairo()

void PlatformContextCairo::save()
{
m_stateStack.append(State(*m_state));
m_stateStack.append(State(m_state->m_globalAlpha, m_state->m_imageInterpolationQuality));
m_state = &m_stateStack.last();

cairo_save(m_cr.get());
Expand Down

0 comments on commit 35aed2f

Please sign in to comment.