summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host
diff options
context:
space:
mode:
authorpkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-29 16:17:55 +0000
committerpkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-29 16:17:55 +0000
commitc155c2541dc88c972115d28be7b66b152a1bedc3 (patch)
tree4a089075a7d510a4c6d5ce03e11bd8e62095576f /chrome/browser/renderer_host
parentea04e3db379d4ad27938969b2dc4b59f9e1db557 (diff)
downloadchromium_src-c155c2541dc88c972115d28be7b66b152a1bedc3.zip
chromium_src-c155c2541dc88c972115d28be7b66b152a1bedc3.tar.gz
chromium_src-c155c2541dc88c972115d28be7b66b152a1bedc3.tar.bz2
First pass for eliminating double painting
A simple 3D CSS benchmark shows a 20% improvement in framerate on T25 hardware: an increase from about 30 fps to 36 fps. This is a first pass to getting rid of double painting by introducing a hole in layers Currently a layer which wants its parent not to paint under it will call SetParentLayerHoley There are a number of questions in terms of implementation: 1) We are doing this with layers. We are currently setting all layers to be holey if the touch_ui flag is enabled. Another option is to merge the holey functionality into regular layers. (Get rid of the holey layer subclass) 2) We are always generating vertices matrix, even in the ui::Layer case, is this ok? 3) We are wasting video memory. We are still uploading a full bitmap. I wasn't able to find a function call which would be able to efficiently slice the bigger bitmap, notably changing the origin of where the painting starts (texture upload) git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91848 0039d316-1c4b-4281-b951-d872f2087c98 BUG= TEST= Review URL: http://codereview.chromium.org/7330025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94677 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host')
-rw-r--r--chrome/browser/renderer_host/accelerated_surface_container_touch.cc21
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_views.cc5
2 files changed, 20 insertions, 6 deletions
diff --git a/chrome/browser/renderer_host/accelerated_surface_container_touch.cc b/chrome/browser/renderer_host/accelerated_surface_container_touch.cc
index a517300..a4f2eb7 100644
--- a/chrome/browser/renderer_host/accelerated_surface_container_touch.cc
+++ b/chrome/browser/renderer_host/accelerated_surface_container_touch.cc
@@ -13,6 +13,7 @@
#include "ui/gfx/gl/gl_bindings.h"
#include "ui/gfx/gl/gl_implementation.h"
#include "ui/gfx/gl/gl_surface_egl.h"
+#include "ui/gfx/rect.h"
#include "ui/gfx/gl/gl_surface_glx.h"
#include "ui/gfx/transform.h"
@@ -25,7 +26,8 @@ class AcceleratedSurfaceContainerTouchEGL
const gfx::Size& size,
uint64 surface_handle);
// TextureGL implementation
- virtual void Draw(const ui::TextureDrawParams& params) OVERRIDE;
+ virtual void Draw(const ui::TextureDrawParams& params,
+ const gfx::Rect& clip_bounds) OVERRIDE;
private:
~AcceleratedSurfaceContainerTouchEGL();
@@ -41,7 +43,8 @@ class AcceleratedSurfaceContainerTouchGLX
const gfx::Size& size,
uint64 surface_handle);
// TextureGL implementation
- virtual void Draw(const ui::TextureDrawParams& params) OVERRIDE;
+ virtual void Draw(const ui::TextureDrawParams& params,
+ const gfx::Rect& clip_bounds) OVERRIDE;
private:
~AcceleratedSurfaceContainerTouchGLX();
@@ -86,7 +89,8 @@ AcceleratedSurfaceContainerTouchEGL::~AcceleratedSurfaceContainerTouchEGL() {
}
void AcceleratedSurfaceContainerTouchEGL::Draw(
- const ui::TextureDrawParams& params) {
+ const ui::TextureDrawParams& params,
+ const gfx::Rect& clip_bounds) {
DCHECK(compositor_->program_no_swizzle());
ui::TextureDrawParams modified_params = params;
@@ -99,7 +103,9 @@ void AcceleratedSurfaceContainerTouchEGL::Draw(
modified_params.transform = flipped;
- DrawInternal(*compositor_->program_no_swizzle(), modified_params);
+ DrawInternal(*compositor_->program_no_swizzle(),
+ modified_params,
+ clip_bounds);
}
AcceleratedSurfaceContainerTouchGLX::AcceleratedSurfaceContainerTouchGLX(
@@ -198,13 +204,16 @@ AcceleratedSurfaceContainerTouchGLX::~AcceleratedSurfaceContainerTouchGLX() {
}
void AcceleratedSurfaceContainerTouchGLX::Draw(
- const ui::TextureDrawParams& params) {
+ const ui::TextureDrawParams& params,
+ const gfx::Rect& clip_bounds) {
DCHECK(compositor_->program_no_swizzle());
Display* dpy = gfx::GLSurfaceGLX::GetDisplay();
glBindTexture(GL_TEXTURE_2D, texture_id_);
glXBindTexImageEXT(dpy, glx_pixmap_, GLX_FRONT_LEFT_EXT, NULL);
- DrawInternal(*compositor_->program_no_swizzle(), params);
+ DrawInternal(*compositor_->program_no_swizzle(),
+ params,
+ clip_bounds);
glXReleaseTexImageEXT(dpy, glx_pixmap_, GLX_FRONT_LEFT_EXT);
}
diff --git a/chrome/browser/renderer_host/render_widget_host_view_views.cc b/chrome/browser/renderer_host/render_widget_host_view_views.cc
index a0bf2d2..858547c 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_views.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_views.cc
@@ -90,6 +90,11 @@ RenderWidgetHostViewViews::RenderWidgetHostViewViews(RenderWidgetHost* host)
has_composition_text_(false) {
set_focusable(true);
host_->SetView(this);
+
+#if defined(TOUCH_UI)
+ SetPaintToLayer(true);
+ SetFillsBoundsOpaquely(true);
+#endif
}
RenderWidgetHostViewViews::~RenderWidgetHostViewViews() {