summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbacker@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-12 15:16:58 +0000
committerbacker@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-12 15:16:58 +0000
commite1e4764e8bb875391a5888bfb2996b86fa538a4f (patch)
treec42181cc43bed157f5b410fc3f0d2cb96282257d
parenta7b09ca2a399d8ab1ae37f7e10b0211835f27f88 (diff)
downloadchromium_src-e1e4764e8bb875391a5888bfb2996b86fa538a4f.zip
chromium_src-e1e4764e8bb875391a5888bfb2996b86fa538a4f.tar.gz
chromium_src-e1e4764e8bb875391a5888bfb2996b86fa538a4f.tar.bz2
Gets rid of chrome being cleared for a moment when keyboard is hidden
When the keyboard was hidden, the chrome would be temporarily hidden while the ui was layed out. This patch gets rid of this. The problem was that the texture bounds is delayed some delay after the layer bounds are set. This would make the math fail inside drawInternal BUG= TEST= Review URL: http://codereview.chromium.org/7461152 Patch from Peter Kotwicz <pkotwicz@chromium.org>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96557 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/renderer_host/accelerated_surface_container_touch.cc12
-rw-r--r--ui/gfx/compositor/compositor.h2
-rw-r--r--ui/gfx/compositor/compositor_gl.cc10
-rw-r--r--ui/gfx/compositor/compositor_gl.h4
-rw-r--r--ui/gfx/compositor/compositor_win.cc4
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();
}