| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ | 5 #ifndef CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ |
| 6 #define CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ | 6 #define CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ |
| 7 | 7 |
| 8 #include "base/time.h" | 8 #include "base/time.h" |
| 9 #include "cc/debug/rendering_stats.h" | 9 #include "cc/debug/rendering_stats.h" |
| 10 #include "cc/trees/layer_tree_host_client.h" | 10 #include "cc/trees/layer_tree_host_client.h" |
| 11 #include "cc/trees/layer_tree_settings.h" | 11 #include "cc/trees/layer_tree_settings.h" |
| 12 #include "skia/ext/refptr.h" | 12 #include "skia/ext/refptr.h" |
| 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeView.h" | 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeView.h" |
| 14 #include "ui/gfx/rect.h" |
| 14 | 15 |
| 15 class SkPicture; | 16 class SkPicture; |
| 16 | 17 |
| 17 namespace cc { | 18 namespace cc { |
| 18 class LayerTreeHost; | 19 class LayerTreeHost; |
| 19 } | 20 } |
| 20 | 21 |
| 21 namespace content { | 22 namespace content { |
| 22 class RenderWidget; | 23 class RenderWidget; |
| 23 | 24 |
| 24 class RenderWidgetCompositor : public WebKit::WebLayerTreeView, | 25 class RenderWidgetCompositor : public WebKit::WebLayerTreeView, |
| 25 public cc::LayerTreeHostClient { | 26 public cc::LayerTreeHostClient { |
| 26 public: | 27 public: |
| 27 // Attempt to construct and initialize a compositor instance for the widget | 28 // Attempt to construct and initialize a compositor instance for the widget |
| 28 // with the given settings. Returns NULL if initialization fails. | 29 // with the given settings. Returns NULL if initialization fails. |
| 29 static scoped_ptr<RenderWidgetCompositor> Create(RenderWidget* widget); | 30 static scoped_ptr<RenderWidgetCompositor> Create(RenderWidget* widget); |
| 30 | 31 |
| 31 virtual ~RenderWidgetCompositor(); | 32 virtual ~RenderWidgetCompositor(); |
| 32 | 33 |
| 33 void SetSuppressScheduleComposite(bool suppress); | 34 void SetSuppressScheduleComposite(bool suppress); |
| 34 void Animate(base::TimeTicks time); | 35 void Animate(base::TimeTicks time); |
| 35 void Composite(base::TimeTicks frame_begin_time); | 36 void Composite(base::TimeTicks frame_begin_time); |
| 36 void GetRenderingStats(cc::RenderingStats* stats); | 37 void GetRenderingStats(cc::RenderingStats* stats); |
| 37 skia::RefPtr<SkPicture> CapturePicture(); | 38 skia::RefPtr<SkPicture> CapturePicture(); |
| 38 void UpdateTopControlsState(bool enable_hiding, | 39 void UpdateTopControlsState(bool enable_hiding, |
| 39 bool enable_showing, | 40 bool enable_showing, |
| 40 bool animate); | 41 bool animate); |
| 41 void SetOverdrawBottomHeight(float overdraw_bottom_height); | 42 void SetOverdrawBottomHeight(float overdraw_bottom_height); |
| 43 void SetNeedsRedrawRect(gfx::Rect damage_rect); |
| 42 | 44 |
| 43 // WebLayerTreeView implementation. | 45 // WebLayerTreeView implementation. |
| 44 virtual void setSurfaceReady(); | 46 virtual void setSurfaceReady(); |
| 45 virtual void setRootLayer(const WebKit::WebLayer& layer); | 47 virtual void setRootLayer(const WebKit::WebLayer& layer); |
| 46 virtual void clearRootLayer(); | 48 virtual void clearRootLayer(); |
| 47 virtual void setViewportSize( | 49 virtual void setViewportSize( |
| 48 const WebKit::WebSize& unused_deprecated, | 50 const WebKit::WebSize& unused_deprecated, |
| 49 const WebKit::WebSize& device_viewport_size); | 51 const WebKit::WebSize& device_viewport_size); |
| 50 virtual WebKit::WebSize layoutViewportSize() const; | 52 virtual WebKit::WebSize layoutViewportSize() const; |
| 51 virtual WebKit::WebSize deviceViewportSize() const; | 53 virtual WebKit::WebSize deviceViewportSize() const; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 bool threaded_; | 107 bool threaded_; |
| 106 bool suppress_schedule_composite_; | 108 bool suppress_schedule_composite_; |
| 107 RenderWidget* widget_; | 109 RenderWidget* widget_; |
| 108 scoped_ptr<cc::LayerTreeHost> layer_tree_host_; | 110 scoped_ptr<cc::LayerTreeHost> layer_tree_host_; |
| 109 }; | 111 }; |
| 110 | 112 |
| 111 } // namespace content | 113 } // namespace content |
| 112 | 114 |
| 113 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ | 115 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ |
| 114 | 116 |
| OLD | NEW |