Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Side by Side Diff: ui/gfx/compositor/layer.h

Issue 8307001: Enable accelerated compositing of web pages when using webkit compositor (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: rebase Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/gfx/compositor/compositor_gl.cc ('k') | ui/gfx/compositor/layer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_GFX_COMPOSITOR_LAYER_H_ 5 #ifndef UI_GFX_COMPOSITOR_LAYER_H_
6 #define UI_GFX_COMPOSITOR_LAYER_H_ 6 #define UI_GFX_COMPOSITOR_LAYER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/message_loop.h" 14 #include "base/message_loop.h"
15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebContentLayer.h"
16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebContentLayerClient .h" 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebContentLayerClient .h"
16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebLayer.h"
17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebLayerClient.h" 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebLayerClient.h"
18 #include "ui/gfx/rect.h" 18 #include "ui/gfx/rect.h"
19 #include "ui/gfx/transform.h" 19 #include "ui/gfx/transform.h"
20 #include "ui/gfx/compositor/compositor.h" 20 #include "ui/gfx/compositor/compositor.h"
21 #include "ui/gfx/compositor/layer_animation_manager.h" 21 #include "ui/gfx/compositor/layer_animation_manager.h"
22 #include "ui/gfx/compositor/layer_animator_delegate.h" 22 #include "ui/gfx/compositor/layer_animator_delegate.h"
23 #include "ui/gfx/compositor/layer_delegate.h" 23 #include "ui/gfx/compositor/layer_delegate.h"
24 24
25 class SkCanvas; 25 class SkCanvas;
26 26
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 // (e.g. the GPU process on TOUCH_UI). 172 // (e.g. the GPU process on TOUCH_UI).
173 bool layer_updated_externally() const { return layer_updated_externally_; } 173 bool layer_updated_externally() const { return layer_updated_externally_; }
174 174
175 // WebLayerClient 175 // WebLayerClient
176 virtual void notifyNeedsComposite(); 176 virtual void notifyNeedsComposite();
177 177
178 // WebContentLayerClient 178 // WebContentLayerClient
179 virtual void paintContents(WebKit::WebCanvas*, const WebKit::WebRect& clip); 179 virtual void paintContents(WebKit::WebCanvas*, const WebKit::WebRect& clip);
180 180
181 #if defined(USE_WEBKIT_COMPOSITOR) 181 #if defined(USE_WEBKIT_COMPOSITOR)
182 WebKit::WebContentLayer web_layer() { return web_layer_; } 182 WebKit::WebLayer web_layer() { return web_layer_; }
183 #endif 183 #endif
184 184
185 private: 185 private:
186 // TODO(vollick): Eventually, if a non-leaf node has an opacity of less than 186 // TODO(vollick): Eventually, if a non-leaf node has an opacity of less than
187 // 1.0, we'll render to a separate texture, and then apply the alpha. 187 // 1.0, we'll render to a separate texture, and then apply the alpha.
188 // Currently, we multiply our opacity by all our ancestor's opacities and 188 // Currently, we multiply our opacity by all our ancestor's opacities and
189 // use the combined result, but this is only temporary. 189 // use the combined result, but this is only temporary.
190 float GetCombinedOpacity() const; 190 float GetCombinedOpacity() const;
191 191
192 // Called during the Draw() pass to freshen the Layer's contents from the 192 // Called during the Draw() pass to freshen the Layer's contents from the
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 // If true the layer is always up to date. 289 // If true the layer is always up to date.
290 bool layer_updated_externally_; 290 bool layer_updated_externally_;
291 291
292 float opacity_; 292 float opacity_;
293 293
294 LayerDelegate* delegate_; 294 LayerDelegate* delegate_;
295 295
296 scoped_ptr<LayerAnimationManager> animator_; 296 scoped_ptr<LayerAnimationManager> animator_;
297 297
298 #if defined(USE_WEBKIT_COMPOSITOR) 298 #if defined(USE_WEBKIT_COMPOSITOR)
299 WebKit::WebContentLayer web_layer_; 299 WebKit::WebLayer web_layer_;
300 bool web_layer_is_accelerated_;
300 #endif 301 #endif
301 302
302 DISALLOW_COPY_AND_ASSIGN(Layer); 303 DISALLOW_COPY_AND_ASSIGN(Layer);
303 }; 304 };
304 305
305 } // namespace ui 306 } // namespace ui
306 307
307 #endif // UI_GFX_COMPOSITOR_LAYER_H_ 308 #endif // UI_GFX_COMPOSITOR_LAYER_H_
OLDNEW
« no previous file with comments | « ui/gfx/compositor/compositor_gl.cc ('k') | ui/gfx/compositor/layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698