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

Side by Side Diff: cc/trees/layer_tree_host.h

Issue 13844021: Move compositor thread input handling logic into content (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months 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
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 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 CC_TREES_LAYER_TREE_HOST_H_ 5 #ifndef CC_TREES_LAYER_TREE_HOST_H_
6 #define CC_TREES_LAYER_TREE_HOST_H_ 6 #define CC_TREES_LAYER_TREE_HOST_H_
7 7
8 #include <limits> 8 #include <limits>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/cancelable_callback.h" 12 #include "base/cancelable_callback.h"
13 #include "base/hash_tables.h" 13 #include "base/hash_tables.h"
14 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
15 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
16 #include "base/memory/weak_ptr.h" 16 #include "base/memory/weak_ptr.h"
17 #include "base/time.h" 17 #include "base/time.h"
18 #include "cc/animation/animation_events.h" 18 #include "cc/animation/animation_events.h"
19 #include "cc/base/cc_export.h" 19 #include "cc/base/cc_export.h"
20 #include "cc/base/scoped_ptr_vector.h" 20 #include "cc/base/scoped_ptr_vector.h"
21 #include "cc/debug/latency_info.h" 21 #include "cc/debug/latency_info.h"
22 #include "cc/input/input_handler.h"
danakj 2013/05/01 19:20:43 Just forward declare this class?
22 #include "cc/layers/layer_lists.h" 23 #include "cc/layers/layer_lists.h"
23 #include "cc/output/output_surface.h" 24 #include "cc/output/output_surface.h"
24 #include "cc/scheduler/rate_limiter.h" 25 #include "cc/scheduler/rate_limiter.h"
25 #include "cc/trees/layer_tree_host_client.h" 26 #include "cc/trees/layer_tree_host_client.h"
26 #include "cc/trees/layer_tree_host_common.h" 27 #include "cc/trees/layer_tree_host_common.h"
27 #include "cc/trees/layer_tree_settings.h" 28 #include "cc/trees/layer_tree_settings.h"
28 #include "cc/trees/occlusion_tracker.h" 29 #include "cc/trees/occlusion_tracker.h"
29 #include "cc/trees/proxy.h" 30 #include "cc/trees/proxy.h"
30 #include "skia/ext/refptr.h" 31 #include "skia/ext/refptr.h"
31 #include "third_party/WebKit/Source/Platform/chromium/public/WebScrollbar.h" 32 #include "third_party/WebKit/Source/Platform/chromium/public/WebScrollbar.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 void Layout(); 107 void Layout();
107 void BeginCommitOnImplThread(LayerTreeHostImpl* host_impl); 108 void BeginCommitOnImplThread(LayerTreeHostImpl* host_impl);
108 void FinishCommitOnImplThread(LayerTreeHostImpl* host_impl); 109 void FinishCommitOnImplThread(LayerTreeHostImpl* host_impl);
109 gfx::Size PinchZoomScrollbarSize( 110 gfx::Size PinchZoomScrollbarSize(
110 WebKit::WebScrollbar::Orientation orientation) const; 111 WebKit::WebScrollbar::Orientation orientation) const;
111 void SetPinchZoomScrollbarsBoundsAndPosition(); 112 void SetPinchZoomScrollbarsBoundsAndPosition();
112 void CreateAndAddPinchZoomScrollbars(); 113 void CreateAndAddPinchZoomScrollbars();
113 void WillCommit(); 114 void WillCommit();
114 void CommitComplete(); 115 void CommitComplete();
115 scoped_ptr<OutputSurface> CreateOutputSurface(); 116 scoped_ptr<OutputSurface> CreateOutputSurface();
116 scoped_ptr<InputHandlerClient> CreateInputHandlerClient();
117 virtual scoped_ptr<LayerTreeHostImpl> CreateLayerTreeHostImpl( 117 virtual scoped_ptr<LayerTreeHostImpl> CreateLayerTreeHostImpl(
118 LayerTreeHostImplClient* client); 118 LayerTreeHostImplClient* client);
119 void DidLoseOutputSurface(); 119 void DidLoseOutputSurface();
120 enum RecreateResult { 120 enum RecreateResult {
121 RecreateSucceeded, 121 RecreateSucceeded,
122 RecreateFailedButTryAgain, 122 RecreateFailedButTryAgain,
123 RecreateFailedAndGaveUp, 123 RecreateFailedAndGaveUp,
124 }; 124 };
125 RecreateResult RecreateOutputSurface(); 125 RecreateResult RecreateOutputSurface();
126 void DidCommitAndDrawFrame() { client_->DidCommitAndDrawFrame(); } 126 void DidCommitAndDrawFrame() { client_->DidCommitAndDrawFrame(); }
127 void DidCompleteSwapBuffers() { client_->DidCompleteSwapBuffers(); } 127 void DidCompleteSwapBuffers() { client_->DidCompleteSwapBuffers(); }
128 void DeleteContentsTexturesOnImplThread(ResourceProvider* resource_provider); 128 void DeleteContentsTexturesOnImplThread(ResourceProvider* resource_provider);
129 virtual void AcquireLayerTextures(); 129 virtual void AcquireLayerTextures();
130 // Returns false if we should abort this frame due to initialization failure. 130 // Returns false if we should abort this frame due to initialization failure.
131 bool InitializeRendererIfNeeded(); 131 bool InitializeRendererIfNeeded();
132 void UpdateLayers(ResourceUpdateQueue* queue, 132 void UpdateLayers(ResourceUpdateQueue* queue,
133 size_t contents_memory_limit_bytes); 133 size_t contents_memory_limit_bytes);
134 134
135 LayerTreeHostClient* client() { return client_; } 135 LayerTreeHostClient* client() { return client_; }
136 const base::WeakPtr<InputHandler>& GetInputHandler();
136 137
137 void Composite(base::TimeTicks frame_begin_time); 138 void Composite(base::TimeTicks frame_begin_time);
138 139
139 // Only used when compositing on the main thread. 140 // Only used when compositing on the main thread.
140 void ScheduleComposite(); 141 void ScheduleComposite();
141 142
142 // Composites and attempts to read back the result into the provided 143 // Composites and attempts to read back the result into the provided
143 // buffer. If it wasn't possible, e.g. due to context lost, will return 144 // buffer. If it wasn't possible, e.g. due to context lost, will return
144 // false. 145 // false.
145 bool CompositeAndReadback(void* pixels, gfx::Rect rect_in_device_viewport); 146 bool CompositeAndReadback(void* pixels, gfx::Rect rect_in_device_viewport);
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 int num_failed_recreate_attempts_; 299 int num_failed_recreate_attempts_;
299 300
300 scoped_refptr<Layer> root_layer_; 301 scoped_refptr<Layer> root_layer_;
301 scoped_refptr<HeadsUpDisplayLayer> hud_layer_; 302 scoped_refptr<HeadsUpDisplayLayer> hud_layer_;
302 scoped_refptr<ScrollbarLayer> pinch_zoom_scrollbar_horizontal_; 303 scoped_refptr<ScrollbarLayer> pinch_zoom_scrollbar_horizontal_;
303 scoped_refptr<ScrollbarLayer> pinch_zoom_scrollbar_vertical_; 304 scoped_refptr<ScrollbarLayer> pinch_zoom_scrollbar_vertical_;
304 305
305 scoped_ptr<PrioritizedResourceManager> contents_texture_manager_; 306 scoped_ptr<PrioritizedResourceManager> contents_texture_manager_;
306 scoped_ptr<PrioritizedResource> surface_memory_placeholder_; 307 scoped_ptr<PrioritizedResource> surface_memory_placeholder_;
307 308
309 base::WeakPtr<InputHandler> input_handler_weak_ptr_;
308 base::WeakPtr<TopControlsManager> top_controls_manager_weak_ptr_; 310 base::WeakPtr<TopControlsManager> top_controls_manager_weak_ptr_;
309 311
310 LayerTreeSettings settings_; 312 LayerTreeSettings settings_;
311 LayerTreeDebugState debug_state_; 313 LayerTreeDebugState debug_state_;
312 314
313 gfx::Size device_viewport_size_; 315 gfx::Size device_viewport_size_;
314 float overdraw_bottom_height_; 316 float overdraw_bottom_height_;
315 float device_scale_factor_; 317 float device_scale_factor_;
316 318
317 bool visible_; 319 bool visible_;
(...skipping 27 matching lines...) Expand all
345 bool in_paint_layer_contents_; 347 bool in_paint_layer_contents_;
346 348
347 LatencyInfo latency_info_; 349 LatencyInfo latency_info_;
348 350
349 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); 351 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost);
350 }; 352 };
351 353
352 } // namespace cc 354 } // namespace cc
353 355
354 #endif // CC_TREES_LAYER_TREE_HOST_H_ 356 #endif // CC_TREES_LAYER_TREE_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698