diff options
-rw-r--r-- | chrome/browser/renderer_host/accelerated_surface_container_touch.cc | 12 | ||||
-rw-r--r-- | ui/gfx/compositor/compositor.h | 2 | ||||
-rw-r--r-- | ui/gfx/compositor/compositor_gl.cc | 10 | ||||
-rw-r--r-- | ui/gfx/compositor/compositor_gl.h | 4 | ||||
-rw-r--r-- | ui/gfx/compositor/compositor_win.cc | 4 |
5 files changed, 18 insertions, 14 deletions
diff --git a/chrome/browser/renderer_host/accelerated_surface_container_touch.cc b/chrome/browser/renderer_host/accelerated_surface_container_touch.cc index a4f2eb7..e3a5237 100644 --- a/chrome/browser/renderer_host/accelerated_surface_container_touch.cc +++ b/chrome/browser/renderer_host/accelerated_surface_container_touch.cc @@ -27,7 +27,7 @@ class AcceleratedSurfaceContainerTouchEGL uint64 surface_handle); // TextureGL implementation virtual void Draw(const ui::TextureDrawParams& params, - const gfx::Rect& clip_bounds) OVERRIDE; + const gfx::Rect& clip_bounds_in_texture) OVERRIDE; private: ~AcceleratedSurfaceContainerTouchEGL(); @@ -44,7 +44,7 @@ class AcceleratedSurfaceContainerTouchGLX uint64 surface_handle); // TextureGL implementation virtual void Draw(const ui::TextureDrawParams& params, - const gfx::Rect& clip_bounds) OVERRIDE; + const gfx::Rect& clip_bounds_in_texture) OVERRIDE; private: ~AcceleratedSurfaceContainerTouchGLX(); @@ -90,7 +90,7 @@ AcceleratedSurfaceContainerTouchEGL::~AcceleratedSurfaceContainerTouchEGL() { void AcceleratedSurfaceContainerTouchEGL::Draw( const ui::TextureDrawParams& params, - const gfx::Rect& clip_bounds) { + const gfx::Rect& clip_bounds_in_texture) { DCHECK(compositor_->program_no_swizzle()); ui::TextureDrawParams modified_params = params; @@ -105,7 +105,7 @@ void AcceleratedSurfaceContainerTouchEGL::Draw( DrawInternal(*compositor_->program_no_swizzle(), modified_params, - clip_bounds); + clip_bounds_in_texture); } AcceleratedSurfaceContainerTouchGLX::AcceleratedSurfaceContainerTouchGLX( @@ -205,7 +205,7 @@ AcceleratedSurfaceContainerTouchGLX::~AcceleratedSurfaceContainerTouchGLX() { void AcceleratedSurfaceContainerTouchGLX::Draw( const ui::TextureDrawParams& params, - const gfx::Rect& clip_bounds) { + const gfx::Rect& clip_bounds_in_texture) { DCHECK(compositor_->program_no_swizzle()); Display* dpy = gfx::GLSurfaceGLX::GetDisplay(); @@ -213,7 +213,7 @@ void AcceleratedSurfaceContainerTouchGLX::Draw( glXBindTexImageEXT(dpy, glx_pixmap_, GLX_FRONT_LEFT_EXT, NULL); DrawInternal(*compositor_->program_no_swizzle(), params, - clip_bounds); + clip_bounds_in_texture); glXReleaseTexImageEXT(dpy, glx_pixmap_, GLX_FRONT_LEFT_EXT); } diff --git a/ui/gfx/compositor/compositor.h b/ui/gfx/compositor/compositor.h index 9d3bdf5..bd28bda 100644 --- a/ui/gfx/compositor/compositor.h +++ b/ui/gfx/compositor/compositor.h @@ -53,7 +53,7 @@ class Texture : public base::RefCounted<Texture> { // Draws the portion of the texture contained within clip_bounds virtual void Draw(const ui::TextureDrawParams& params, - const gfx::Rect& clip_bounds) = 0; + const gfx::Rect& clip_bounds_in_texture) = 0; protected: virtual ~Texture() {} diff --git a/ui/gfx/compositor/compositor_gl.cc b/ui/gfx/compositor/compositor_gl.cc index b5937ef..6d7bd29 100644 --- a/ui/gfx/compositor/compositor_gl.cc +++ b/ui/gfx/compositor/compositor_gl.cc @@ -338,13 +338,17 @@ void TextureGL::Draw(const ui::TextureDrawParams& params) { } void TextureGL::Draw(const ui::TextureDrawParams& params, - const gfx::Rect& clip_bounds) { + const gfx::Rect& clip_bounds_in_texture) { DCHECK(compositor_->program_swizzle()); - DrawInternal(*compositor_->program_swizzle(), params, clip_bounds); + DrawInternal(*compositor_->program_swizzle(), params, clip_bounds_in_texture); } void TextureGL::DrawInternal(const ui::TextureProgramGL& program, const ui::TextureDrawParams& params, - const gfx::Rect& clip_bounds) { + const gfx::Rect& clip_bounds_in_texture) { + // clip clip_bounds_in_layer to size of texture + gfx::Rect clip_bounds = clip_bounds_in_texture.Intersect( + gfx::Rect(gfx::Point(0, 0), size_)); + if (params.blend) glEnable(GL_BLEND); else diff --git a/ui/gfx/compositor/compositor_gl.h b/ui/gfx/compositor/compositor_gl.h index 716af7e..9699955 100644 --- a/ui/gfx/compositor/compositor_gl.h +++ b/ui/gfx/compositor/compositor_gl.h @@ -36,7 +36,7 @@ class TextureGL : public Texture { virtual void Draw(const ui::TextureDrawParams& params) OVERRIDE; virtual void Draw(const ui::TextureDrawParams& params, - const gfx::Rect& clip_bounds) OVERRIDE; + const gfx::Rect& clip_bounds_in_texture) OVERRIDE; protected: TextureGL(CompositorGL* compositor, const gfx::Size& size); @@ -46,7 +46,7 @@ class TextureGL : public Texture { // Only the region defined by draw_bounds will be drawn. void DrawInternal(const TextureProgramGL& program, const ui::TextureDrawParams& params, - const gfx::Rect& clip_bounds); + const gfx::Rect& clip_bounds_in_texture); unsigned int texture_id_; gfx::Size size_; diff --git a/ui/gfx/compositor/compositor_win.cc b/ui/gfx/compositor/compositor_win.cc index 10fc36b..3afb3c4 100644 --- a/ui/gfx/compositor/compositor_win.cc +++ b/ui/gfx/compositor/compositor_win.cc @@ -58,7 +58,7 @@ class ViewTexture : public Texture { virtual void Draw(const ui::TextureDrawParams& params) OVERRIDE; virtual void Draw(const ui::TextureDrawParams& params, - const gfx::Rect& clip_bounds) OVERRIDE; + const gfx::Rect& clip_bounds_in_texture) OVERRIDE; private: ~ViewTexture(); @@ -273,7 +273,7 @@ void ViewTexture::Draw(const ui::TextureDrawParams& params) { } void ViewTexture::Draw(const ui::TextureDrawParams& params, - const gfx::Rect& clip_bounds) { + const gfx::Rect& clip_bounds_in_texture) { NOTIMPLEMENTED(); } |