Commit e1e4764e authored by backer@chromium.org's avatar backer@chromium.org

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
parent a7b09ca2
...@@ -27,7 +27,7 @@ class AcceleratedSurfaceContainerTouchEGL ...@@ -27,7 +27,7 @@ class AcceleratedSurfaceContainerTouchEGL
uint64 surface_handle); uint64 surface_handle);
// TextureGL implementation // TextureGL implementation
virtual void Draw(const ui::TextureDrawParams& params, virtual void Draw(const ui::TextureDrawParams& params,
const gfx::Rect& clip_bounds) OVERRIDE; const gfx::Rect& clip_bounds_in_texture) OVERRIDE;
private: private:
~AcceleratedSurfaceContainerTouchEGL(); ~AcceleratedSurfaceContainerTouchEGL();
...@@ -44,7 +44,7 @@ class AcceleratedSurfaceContainerTouchGLX ...@@ -44,7 +44,7 @@ class AcceleratedSurfaceContainerTouchGLX
uint64 surface_handle); uint64 surface_handle);
// TextureGL implementation // TextureGL implementation
virtual void Draw(const ui::TextureDrawParams& params, virtual void Draw(const ui::TextureDrawParams& params,
const gfx::Rect& clip_bounds) OVERRIDE; const gfx::Rect& clip_bounds_in_texture) OVERRIDE;
private: private:
~AcceleratedSurfaceContainerTouchGLX(); ~AcceleratedSurfaceContainerTouchGLX();
...@@ -90,7 +90,7 @@ AcceleratedSurfaceContainerTouchEGL::~AcceleratedSurfaceContainerTouchEGL() { ...@@ -90,7 +90,7 @@ AcceleratedSurfaceContainerTouchEGL::~AcceleratedSurfaceContainerTouchEGL() {
void AcceleratedSurfaceContainerTouchEGL::Draw( void AcceleratedSurfaceContainerTouchEGL::Draw(
const ui::TextureDrawParams& params, const ui::TextureDrawParams& params,
const gfx::Rect& clip_bounds) { const gfx::Rect& clip_bounds_in_texture) {
DCHECK(compositor_->program_no_swizzle()); DCHECK(compositor_->program_no_swizzle());
ui::TextureDrawParams modified_params = params; ui::TextureDrawParams modified_params = params;
...@@ -105,7 +105,7 @@ void AcceleratedSurfaceContainerTouchEGL::Draw( ...@@ -105,7 +105,7 @@ void AcceleratedSurfaceContainerTouchEGL::Draw(
DrawInternal(*compositor_->program_no_swizzle(), DrawInternal(*compositor_->program_no_swizzle(),
modified_params, modified_params,
clip_bounds); clip_bounds_in_texture);
} }
AcceleratedSurfaceContainerTouchGLX::AcceleratedSurfaceContainerTouchGLX( AcceleratedSurfaceContainerTouchGLX::AcceleratedSurfaceContainerTouchGLX(
...@@ -205,7 +205,7 @@ AcceleratedSurfaceContainerTouchGLX::~AcceleratedSurfaceContainerTouchGLX() { ...@@ -205,7 +205,7 @@ AcceleratedSurfaceContainerTouchGLX::~AcceleratedSurfaceContainerTouchGLX() {
void AcceleratedSurfaceContainerTouchGLX::Draw( void AcceleratedSurfaceContainerTouchGLX::Draw(
const ui::TextureDrawParams& params, const ui::TextureDrawParams& params,
const gfx::Rect& clip_bounds) { const gfx::Rect& clip_bounds_in_texture) {
DCHECK(compositor_->program_no_swizzle()); DCHECK(compositor_->program_no_swizzle());
Display* dpy = gfx::GLSurfaceGLX::GetDisplay(); Display* dpy = gfx::GLSurfaceGLX::GetDisplay();
...@@ -213,7 +213,7 @@ void AcceleratedSurfaceContainerTouchGLX::Draw( ...@@ -213,7 +213,7 @@ void AcceleratedSurfaceContainerTouchGLX::Draw(
glXBindTexImageEXT(dpy, glx_pixmap_, GLX_FRONT_LEFT_EXT, NULL); glXBindTexImageEXT(dpy, glx_pixmap_, GLX_FRONT_LEFT_EXT, NULL);
DrawInternal(*compositor_->program_no_swizzle(), DrawInternal(*compositor_->program_no_swizzle(),
params, params,
clip_bounds); clip_bounds_in_texture);
glXReleaseTexImageEXT(dpy, glx_pixmap_, GLX_FRONT_LEFT_EXT); glXReleaseTexImageEXT(dpy, glx_pixmap_, GLX_FRONT_LEFT_EXT);
} }
......
...@@ -53,7 +53,7 @@ class Texture : public base::RefCounted<Texture> { ...@@ -53,7 +53,7 @@ class Texture : public base::RefCounted<Texture> {
// Draws the portion of the texture contained within clip_bounds // Draws the portion of the texture contained within clip_bounds
virtual void Draw(const ui::TextureDrawParams& params, virtual void Draw(const ui::TextureDrawParams& params,
const gfx::Rect& clip_bounds) = 0; const gfx::Rect& clip_bounds_in_texture) = 0;
protected: protected:
virtual ~Texture() {} virtual ~Texture() {}
......
...@@ -338,13 +338,17 @@ void TextureGL::Draw(const ui::TextureDrawParams& params) { ...@@ -338,13 +338,17 @@ void TextureGL::Draw(const ui::TextureDrawParams& params) {
} }
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()); 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, void TextureGL::DrawInternal(const ui::TextureProgramGL& program,
const ui::TextureDrawParams& params, 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) if (params.blend)
glEnable(GL_BLEND); glEnable(GL_BLEND);
else else
......
...@@ -36,7 +36,7 @@ class TextureGL : public Texture { ...@@ -36,7 +36,7 @@ class TextureGL : public Texture {
virtual void Draw(const ui::TextureDrawParams& params) OVERRIDE; virtual void Draw(const ui::TextureDrawParams& params) OVERRIDE;
virtual void Draw(const ui::TextureDrawParams& params, virtual void Draw(const ui::TextureDrawParams& params,
const gfx::Rect& clip_bounds) OVERRIDE; const gfx::Rect& clip_bounds_in_texture) OVERRIDE;
protected: protected:
TextureGL(CompositorGL* compositor, const gfx::Size& size); TextureGL(CompositorGL* compositor, const gfx::Size& size);
...@@ -46,7 +46,7 @@ class TextureGL : public Texture { ...@@ -46,7 +46,7 @@ class TextureGL : public Texture {
// Only the region defined by draw_bounds will be drawn. // Only the region defined by draw_bounds will be drawn.
void DrawInternal(const TextureProgramGL& program, void DrawInternal(const TextureProgramGL& program,
const ui::TextureDrawParams& params, const ui::TextureDrawParams& params,
const gfx::Rect& clip_bounds); const gfx::Rect& clip_bounds_in_texture);
unsigned int texture_id_; unsigned int texture_id_;
gfx::Size size_; gfx::Size size_;
......
...@@ -58,7 +58,7 @@ class ViewTexture : public Texture { ...@@ -58,7 +58,7 @@ class ViewTexture : public Texture {
virtual void Draw(const ui::TextureDrawParams& params) OVERRIDE; virtual void Draw(const ui::TextureDrawParams& params) OVERRIDE;
virtual void Draw(const ui::TextureDrawParams& params, virtual void Draw(const ui::TextureDrawParams& params,
const gfx::Rect& clip_bounds) OVERRIDE; const gfx::Rect& clip_bounds_in_texture) OVERRIDE;
private: private:
~ViewTexture(); ~ViewTexture();
...@@ -273,7 +273,7 @@ void ViewTexture::Draw(const ui::TextureDrawParams& params) { ...@@ -273,7 +273,7 @@ void ViewTexture::Draw(const ui::TextureDrawParams& params) {
} }
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(); NOTIMPLEMENTED();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment