From c797cd43680b525ea771dc226ca353078c5c56f1 Mon Sep 17 00:00:00 2001 From: "sadrul@chromium.org" Date: Tue, 15 Mar 2011 02:18:36 +0000 Subject: Start working on compositor tree painting. As a first step, maintain a skia canvas in each transformed view. Each transformed view will acquire a texture-id for the canvas it owns. Whenever the canvas is updated, it will trigger a refresh in the compositor tree. BUG=none TEST=none Review URL: http://codereview.chromium.org/6594125 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78149 0039d316-1c4b-4281-b951-d872f2087c98 --- views/view.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'views/view.h') diff --git a/views/view.h b/views/view.h index 8117ab2..e09f0bee 100644 --- a/views/view.h +++ b/views/view.h @@ -34,8 +34,11 @@ class Path; namespace ui { struct AccessibleViewState; +class Compositor; class ThemeProvider; class Transform; + +typedef unsigned int TextureID; } using ui::ThemeProvider; @@ -562,6 +565,11 @@ class View : public AcceleratorTarget { flip_canvas_on_paint_for_rtl_ui_ = enable; } + // Accelerated painting ------------------------------------------------------ + + // Enable/Disable accelerated compositing. + static void set_use_acceleration_when_possible(bool use); + // Input --------------------------------------------------------------------- // The points (and mouse locations) in the following functions are in the // view's coordinates, except for a RootView. @@ -1016,6 +1024,11 @@ class View : public AcceleratorTarget { // relevant contents. virtual void OnPaintFocusBorder(gfx::Canvas* canvas); + // Accelerated painting ------------------------------------------------------ + + // Performs accelerated painting using the compositor. + virtual void PaintComposite(ui::Compositor* compositor); + // Input --------------------------------------------------------------------- // Called by HitTest to see if this View has a custom hit test mask. If the @@ -1333,6 +1346,16 @@ class View : public AcceleratorTarget { // right-to-left locales for this View. bool flip_canvas_on_paint_for_rtl_ui_; + // Accelerated painting ------------------------------------------------------ + + // Each transformed view will maintain its own canvas. + scoped_ptr canvas_; + + // Texture ID used for accelerated painting. + // TODO(sadrul): This will eventually be replaced by an abstract texture + // object. + ui::TextureID texture_id_; + // Accelerators -------------------------------------------------------------- // true if when we were added to hierarchy we were without focus manager -- cgit v1.1