Skip to content
Permalink
Browse files
2011-04-21 Nat Duca <nduca@chromium.org>
        Reviewed by James Robinson.

        [chromium] Fix artefacts in compositor HUD when resizing
        https://bugs.webkit.org/show_bug.cgi?id=58969

        HUD was using the tiler program and not setting the texture
        transform. The HUD would thus draw with a texture transform based
        on the last tile drawn, leading sometimes to distortion.

        * platform/graphics/chromium/LayerRendererChromium.cpp:
        (WebCore::LayerRendererChromium::initializeSharedObjects):
        (WebCore::LayerRendererChromium::cleanupSharedObjects):
        * platform/graphics/chromium/LayerRendererChromium.h:
        (WebCore::LayerRendererChromium::headsUpDisplayProgram):
        * platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp:
        (WebCore::CCHeadsUpDisplay::draw):
        * platform/graphics/chromium/cc/CCHeadsUpDisplay.h:

Canonical link: https://commits.webkit.org/74285@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@84546 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
webkit-commit-queue committed Apr 21, 2011
1 parent e856a37 commit 5c8fd06b123d7f0fee6a0d1bbc134f59baaaab0b
@@ -1,3 +1,23 @@
2011-04-21 Nat Duca <nduca@chromium.org>

Reviewed by James Robinson.

[chromium] Fix artefacts in compositor HUD when resizing
https://bugs.webkit.org/show_bug.cgi?id=58969

HUD was using the tiler program and not setting the texture
transform. The HUD would thus draw with a texture transform based
on the last tile drawn, leading sometimes to distortion.

* platform/graphics/chromium/LayerRendererChromium.cpp:
(WebCore::LayerRendererChromium::initializeSharedObjects):
(WebCore::LayerRendererChromium::cleanupSharedObjects):
* platform/graphics/chromium/LayerRendererChromium.h:
(WebCore::LayerRendererChromium::headsUpDisplayProgram):
* platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp:
(WebCore::CCHeadsUpDisplay::draw):
* platform/graphics/chromium/cc/CCHeadsUpDisplay.h:

2011-04-21 Mike Reed <reed@google.com>

Reviewed by Kenneth Russell.
@@ -985,6 +985,7 @@ bool LayerRendererChromium::initializeSharedObjects()

m_sharedGeometry = adoptPtr(new GeometryBinding(m_context.get()));
m_borderProgram = adoptPtr(new LayerChromium::BorderProgram(m_context.get()));
m_headsUpDisplayProgram = adoptPtr(new CCHeadsUpDisplay::Program(m_context.get()));
m_canvasLayerProgram = adoptPtr(new CCCanvasLayerImpl::Program(m_context.get()));
m_videoLayerRGBAProgram = adoptPtr(new CCVideoLayerImpl::RGBAProgram(m_context.get()));
m_videoLayerYUVProgram = adoptPtr(new CCVideoLayerImpl::YUVProgram(m_context.get()));
@@ -995,6 +996,7 @@ bool LayerRendererChromium::initializeSharedObjects()

if (!m_sharedGeometry->initialized() || !m_borderProgram->initialized()
|| !m_canvasLayerProgram->initialized()
|| !m_headsUpDisplayProgram->initialized()
|| !m_videoLayerRGBAProgram->initialized() || !m_videoLayerYUVProgram->initialized()
|| !m_pluginLayerProgram->initialized() || !m_renderSurfaceProgram->initialized()
|| !m_renderSurfaceMaskProgram->initialized() || !m_tilerProgram->initialized()) {
@@ -1014,6 +1016,7 @@ void LayerRendererChromium::cleanupSharedObjects()
m_sharedGeometry.clear();
m_borderProgram.clear();
m_canvasLayerProgram.clear();
m_headsUpDisplayProgram.clear();
m_videoLayerRGBAProgram.clear();
m_videoLayerYUVProgram.clear();
m_pluginLayerProgram.clear();
@@ -110,6 +110,7 @@ class LayerRendererChromium : public RefCounted<LayerRendererChromium> {

const GeometryBinding* sharedGeometry() const { return m_sharedGeometry.get(); }
const LayerChromium::BorderProgram* borderProgram() const { return m_borderProgram.get(); }
const CCHeadsUpDisplay::Program* headsUpDisplayProgram() const { return m_headsUpDisplayProgram.get(); }
const RenderSurfaceChromium::Program* renderSurfaceProgram() const { return m_renderSurfaceProgram.get(); }
const RenderSurfaceChromium::MaskProgram* renderSurfaceMaskProgram() const { return m_renderSurfaceMaskProgram.get(); }
const LayerTilerChromium::Program* tilerProgram() const { return m_tilerProgram.get(); }
@@ -205,6 +206,7 @@ class LayerRendererChromium : public RefCounted<LayerRendererChromium> {
// we cannot store these values in static variables.
OwnPtr<GeometryBinding> m_sharedGeometry;
OwnPtr<LayerChromium::BorderProgram> m_borderProgram;
OwnPtr<CCHeadsUpDisplay::Program> m_headsUpDisplayProgram;
OwnPtr<RenderSurfaceChromium::Program> m_renderSurfaceProgram;
OwnPtr<RenderSurfaceChromium::MaskProgram> m_renderSurfaceMaskProgram;
OwnPtr<LayerTilerChromium::Program> m_tilerProgram;
@@ -32,6 +32,7 @@
#include "FontDescription.h"
#include "GraphicsContext3D.h"
#include "LayerChromium.h"
#include "LayerRendererChromium.h"
#include "LayerTexture.h"
#include "TextRun.h"
#include "TextStream.h"
@@ -109,7 +110,7 @@ void CCHeadsUpDisplay::draw()
}

// Draw the HUD onto the default render surface.
const LayerTilerChromium::Program* program = m_layerRenderer->tilerProgram();
const Program* program = m_layerRenderer->headsUpDisplayProgram();
ASSERT(program && program->initialized());
GLC(context, context->activeTexture(GraphicsContext3D::TEXTURE0));
m_hudTexture->bindTexture();
@@ -28,13 +28,15 @@
#if USE(ACCELERATED_COMPOSITING)

#include "Font.h"
#include "LayerRendererChromium.h"

#include "ProgramBinding.h"
#include "ShaderChromium.h"

namespace WebCore {

class GeometryBinding;
class GraphicsContext3D;
class LayerRendererChromium;
class LayerTexture;

// Class that handles drawing of composited render layers using GL.
class CCHeadsUpDisplay {
@@ -58,6 +60,8 @@ class CCHeadsUpDisplay {
bool enabled() const { return m_showPlatformLayerTree || m_showFPSCounter; }
void draw();

typedef ProgramBinding<VertexShaderPosTex, FragmentShaderBGRATexAlpha> Program;

private:
explicit CCHeadsUpDisplay(LayerRendererChromium* owner);
void drawHudContents(GraphicsContext*, const IntSize& hudSize);

0 comments on commit 5c8fd06

Please sign in to comment.