OLD | NEW |
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" | |
22 #include "cc/input/input_handler.h" | 21 #include "cc/input/input_handler.h" |
23 #include "cc/input/scrollbar.h" | 22 #include "cc/input/scrollbar.h" |
24 #include "cc/input/top_controls_state.h" | 23 #include "cc/input/top_controls_state.h" |
25 #include "cc/layers/layer_lists.h" | 24 #include "cc/layers/layer_lists.h" |
26 #include "cc/output/output_surface.h" | 25 #include "cc/output/output_surface.h" |
27 #include "cc/scheduler/rate_limiter.h" | 26 #include "cc/scheduler/rate_limiter.h" |
28 #include "cc/trees/layer_tree_host_client.h" | 27 #include "cc/trees/layer_tree_host_client.h" |
29 #include "cc/trees/layer_tree_host_common.h" | 28 #include "cc/trees/layer_tree_host_common.h" |
30 #include "cc/trees/layer_tree_settings.h" | 29 #include "cc/trees/layer_tree_settings.h" |
31 #include "cc/trees/occlusion_tracker.h" | 30 #include "cc/trees/occlusion_tracker.h" |
32 #include "cc/trees/proxy.h" | 31 #include "cc/trees/proxy.h" |
33 #include "skia/ext/refptr.h" | 32 #include "skia/ext/refptr.h" |
34 #include "third_party/skia/include/core/SkColor.h" | 33 #include "third_party/skia/include/core/SkColor.h" |
35 #include "third_party/skia/include/core/SkPicture.h" | 34 #include "third_party/skia/include/core/SkPicture.h" |
| 35 #include "ui/base/latency_info.h" |
36 #include "ui/gfx/rect.h" | 36 #include "ui/gfx/rect.h" |
37 | 37 |
38 namespace WebKit { class WebGraphicsContext3D; } | 38 namespace WebKit { class WebGraphicsContext3D; } |
39 | 39 |
40 #if defined(COMPILER_GCC) | 40 #if defined(COMPILER_GCC) |
41 namespace BASE_HASH_NAMESPACE { | 41 namespace BASE_HASH_NAMESPACE { |
42 template <> | 42 template <> |
43 struct hash<WebKit::WebGraphicsContext3D*> { | 43 struct hash<WebKit::WebGraphicsContext3D*> { |
44 size_t operator()(WebKit::WebGraphicsContext3D* ptr) const { | 44 size_t operator()(WebKit::WebGraphicsContext3D* ptr) const { |
45 return hash<size_t>()(reinterpret_cast<size_t>(ptr)); | 45 return hash<size_t>()(reinterpret_cast<size_t>(ptr)); |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 bool visible() const { return visible_; } | 210 bool visible() const { return visible_; } |
211 | 211 |
212 void StartPageScaleAnimation(gfx::Vector2d target_offset, | 212 void StartPageScaleAnimation(gfx::Vector2d target_offset, |
213 bool use_anchor, | 213 bool use_anchor, |
214 float scale, | 214 float scale, |
215 base::TimeDelta duration); | 215 base::TimeDelta duration); |
216 | 216 |
217 void ApplyScrollAndScale(const ScrollAndScaleSet& info); | 217 void ApplyScrollAndScale(const ScrollAndScaleSet& info); |
218 | 218 |
219 void SetImplTransform(const gfx::Transform& transform); | 219 void SetImplTransform(const gfx::Transform& transform); |
220 void SetLatencyInfo(const LatencyInfo& latency_info); | 220 void SetLatencyInfo(const ui::LatencyInfo& latency_info); |
221 | 221 |
222 void StartRateLimiter(WebKit::WebGraphicsContext3D* context3d); | 222 void StartRateLimiter(WebKit::WebGraphicsContext3D* context3d); |
223 void StopRateLimiter(WebKit::WebGraphicsContext3D* context3d); | 223 void StopRateLimiter(WebKit::WebGraphicsContext3D* context3d); |
224 | 224 |
225 // RateLimiterClient implementation. | 225 // RateLimiterClient implementation. |
226 virtual void RateLimit() OVERRIDE; | 226 virtual void RateLimit() OVERRIDE; |
227 | 227 |
228 bool buffered_updates() const { | 228 bool buffered_updates() const { |
229 return settings_.max_partial_texture_updates != | 229 return settings_.max_partial_texture_updates != |
230 std::numeric_limits<size_t>::max(); | 230 std::numeric_limits<size_t>::max(); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 struct PendingPageScaleAnimation { | 341 struct PendingPageScaleAnimation { |
342 gfx::Vector2d target_offset; | 342 gfx::Vector2d target_offset; |
343 bool use_anchor; | 343 bool use_anchor; |
344 float scale; | 344 float scale; |
345 base::TimeDelta duration; | 345 base::TimeDelta duration; |
346 }; | 346 }; |
347 scoped_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; | 347 scoped_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; |
348 | 348 |
349 bool in_paint_layer_contents_; | 349 bool in_paint_layer_contents_; |
350 | 350 |
351 LatencyInfo latency_info_; | 351 ui::LatencyInfo latency_info_; |
352 | 352 |
353 static const int kTotalFramesToUseForLCDTextMetrics = 50; | 353 static const int kTotalFramesToUseForLCDTextMetrics = 50; |
354 int total_frames_used_for_lcd_text_metrics_; | 354 int total_frames_used_for_lcd_text_metrics_; |
355 | 355 |
356 struct LCDTextMetrics { | 356 struct LCDTextMetrics { |
357 LCDTextMetrics() | 357 LCDTextMetrics() |
358 : total_num_cc_layers(0), | 358 : total_num_cc_layers(0), |
359 total_num_cc_layers_can_use_lcd_text(0), | 359 total_num_cc_layers_can_use_lcd_text(0), |
360 total_num_cc_layers_will_use_lcd_text(0) {} | 360 total_num_cc_layers_will_use_lcd_text(0) {} |
361 | 361 |
362 int64 total_num_cc_layers; | 362 int64 total_num_cc_layers; |
363 int64 total_num_cc_layers_can_use_lcd_text; | 363 int64 total_num_cc_layers_can_use_lcd_text; |
364 int64 total_num_cc_layers_will_use_lcd_text; | 364 int64 total_num_cc_layers_will_use_lcd_text; |
365 }; | 365 }; |
366 LCDTextMetrics lcd_text_metrics_; | 366 LCDTextMetrics lcd_text_metrics_; |
367 | 367 |
368 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 368 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
369 }; | 369 }; |
370 | 370 |
371 } // namespace cc | 371 } // namespace cc |
372 | 372 |
373 #endif // CC_TREES_LAYER_TREE_HOST_H_ | 373 #endif // CC_TREES_LAYER_TREE_HOST_H_ |
OLD | NEW |