Index: cc/trees/layer_tree_impl.h |
diff --git a/cc/trees/layer_tree_impl.h b/cc/trees/layer_tree_impl.h |
index 232913933965f14c223c1ba7e83579783ebdecad..54c86604d3435edd63f9d5343787185d09307400 100644 |
--- a/cc/trees/layer_tree_impl.h |
+++ b/cc/trees/layer_tree_impl.h |
@@ -22,13 +22,7 @@ namespace base { |
namespace trace_event { |
class TracedValue; |
} |
- |
-// TODO(ssid): remove these aliases after the tracing clients are moved to the |
-// new trace_event namespace. See crbug.com/451032. ETA: March 2015 |
-namespace debug { |
-using ::base::trace_event::TracedValue; |
} |
-} // namespace base |
namespace cc { |
@@ -55,6 +49,7 @@ struct RendererCapabilities; |
struct SelectionHandle; |
typedef std::vector<UIResourceRequest> UIResourceRequestQueue; |
+typedef SyncedProperty<AdditionGroup<float>> SyncedTopControls; |
typedef SyncedProperty<AdditionGroup<gfx::Vector2dF>> SyncedElasticOverscroll; |
class CC_EXPORT LayerTreeImpl { |
@@ -62,9 +57,11 @@ class CC_EXPORT LayerTreeImpl { |
static scoped_ptr<LayerTreeImpl> create( |
LayerTreeHostImpl* layer_tree_host_impl, |
scoped_refptr<SyncedProperty<ScaleGroup>> page_scale_factor, |
+ scoped_refptr<SyncedTopControls> top_controls_shown_ratio, |
scoped_refptr<SyncedElasticOverscroll> elastic_overscroll) { |
- return make_scoped_ptr(new LayerTreeImpl( |
- layer_tree_host_impl, page_scale_factor, elastic_overscroll)); |
+ return make_scoped_ptr( |
+ new LayerTreeImpl(layer_tree_host_impl, page_scale_factor, |
+ top_controls_shown_ratio, elastic_overscroll)); |
} |
virtual ~LayerTreeImpl(); |
@@ -75,6 +72,7 @@ class CC_EXPORT LayerTreeImpl { |
// Methods called by the layer tree that pass-through or access LTHI. |
// --------------------------------------------------------------------------- |
const LayerTreeSettings& settings() const; |
+ const LayerTreeDebugState& debug_state() const; |
const RendererCapabilitiesImpl& GetRendererCapabilities() const; |
ContextProvider* context_provider() const; |
OutputSurface* output_surface() const; |
@@ -84,6 +82,8 @@ class CC_EXPORT LayerTreeImpl { |
PaintTimeCounter* paint_time_counter() const; |
MemoryHistory* memory_history() const; |
gfx::Size device_viewport_size() const; |
+ float device_scale_factor() const; |
+ DebugRectHistory* debug_rect_history() const; |
bool IsActiveTree() const; |
bool IsPendingTree() const; |
bool IsRecycleTree() const; |
@@ -111,13 +111,10 @@ class CC_EXPORT LayerTreeImpl { |
// --------------------------------------------------------------------------- |
void SetNeedsRedraw(); |
- // TODO(nduca): These are implemented in cc files temporarily, but will become |
- // trivial accessors in a followup patch. |
- const LayerTreeDebugState& debug_state() const; |
- float device_scale_factor() const; |
- DebugRectHistory* debug_rect_history() const; |
+ // Tracing methods. |
+ // --------------------------------------------------------------------------- |
void GetAllTilesForTracing(std::set<const Tile*>* tiles) const; |
- void AsValueInto(base::debug::TracedValue* dict) const; |
+ void AsValueInto(base::trace_event::TracedValue* dict) const; |
// Other public methods |
// --------------------------------------------------------------------------- |
@@ -192,6 +189,13 @@ class CC_EXPORT LayerTreeImpl { |
return elastic_overscroll_.get(); |
} |
+ SyncedTopControls* top_controls_shown_ratio() { |
+ return top_controls_shown_ratio_.get(); |
+ } |
+ const SyncedTopControls* top_controls_shown_ratio() const { |
+ return top_controls_shown_ratio_.get(); |
+ } |
+ |
// Updates draw properties and render surface layer list, as well as tile |
// priorities. Returns false if it was unable to update. |
bool UpdateDrawProperties(); |
@@ -216,6 +220,7 @@ class CC_EXPORT LayerTreeImpl { |
void set_ui_resource_request_queue(const UIResourceRequestQueue& queue); |
const LayerImplList& RenderSurfaceLayerList() const; |
+ const Region& UnoccludedScreenSpaceRegion() const; |
// These return the size of the root scrollable area and the size of |
// the user-visible scrolling viewport, in CSS layout coordinates. |
@@ -273,6 +278,12 @@ class CC_EXPORT LayerTreeImpl { |
bool IsUIResourceOpaque(UIResourceId uid) const; |
+ void RegisterPictureLayerImpl(PictureLayerImpl* layer); |
+ void UnregisterPictureLayerImpl(PictureLayerImpl* layer); |
+ const std::vector<PictureLayerImpl*>& picture_layers() const { |
+ return picture_layers_; |
+ } |
+ |
void AddLayerWithCopyOutputRequest(LayerImpl* layer); |
void RemoveLayerWithCopyOutputRequest(LayerImpl* layer); |
const std::vector<LayerImpl*>& LayersWithCopyOutputRequest() const; |
@@ -300,39 +311,17 @@ class CC_EXPORT LayerTreeImpl { |
void GetViewportSelection(ViewportSelectionBound* start, |
ViewportSelectionBound* end); |
- void RegisterPictureLayerImpl(PictureLayerImpl* layer); |
- void UnregisterPictureLayerImpl(PictureLayerImpl* layer); |
- |
- void set_top_controls_shrink_blink_size(bool shrink) { |
- top_controls_shrink_blink_size_ = shrink; |
- } |
- void set_top_controls_height(float height) { top_controls_height_ = height; } |
- void set_top_controls_content_offset(float offset) { |
- top_controls_content_offset_ = offset; |
- } |
- void set_top_controls_delta(float delta) { |
- top_controls_delta_ = delta; |
- } |
- void set_sent_top_controls_delta(float sent_delta) { |
- sent_top_controls_delta_ = sent_delta; |
- } |
- |
+ void set_top_controls_shrink_blink_size(bool shrink); |
bool top_controls_shrink_blink_size() const { |
return top_controls_shrink_blink_size_; |
} |
- float top_controls_height() const { return top_controls_height_; } |
- float top_controls_content_offset() const { |
- return top_controls_content_offset_; |
- } |
- float top_controls_delta() const { |
- return top_controls_delta_; |
- } |
- float sent_top_controls_delta() const { |
- return sent_top_controls_delta_; |
- } |
- float total_top_controls_content_offset() const { |
- return top_controls_content_offset_ + top_controls_delta_; |
+ bool SetCurrentTopControlsShownRatio(float ratio); |
+ float CurrentTopControlsShownRatio() const { |
+ return top_controls_shown_ratio_->Current(IsActiveTree()); |
} |
+ void set_top_controls_height(float top_controls_height); |
+ float top_controls_height() const { return top_controls_height_; } |
+ void PushTopControlsFromMainThread(float top_controls_shown_ratio); |
void SetPendingPageScaleAnimation( |
scoped_ptr<PendingPageScaleAnimation> pending_animation); |
@@ -342,6 +331,7 @@ class CC_EXPORT LayerTreeImpl { |
explicit LayerTreeImpl( |
LayerTreeHostImpl* layer_tree_host_impl, |
scoped_refptr<SyncedProperty<ScaleGroup>> page_scale_factor, |
+ scoped_refptr<SyncedTopControls> top_controls_shown_ratio, |
scoped_refptr<SyncedElasticOverscroll> elastic_overscroll); |
void ProcessLayersRecursive(LayerImpl* current, |
void (LayerImpl::*function)()); |
@@ -353,7 +343,7 @@ class CC_EXPORT LayerTreeImpl { |
float max_page_scale_factor); |
void DidUpdatePageScale(); |
void HideInnerViewportScrollbarsIfNearMinimumScale(); |
- |
+ void PushTopControls(const float* top_controls_shown_ratio); |
LayerTreeHostImpl* layer_tree_host_impl_; |
int source_frame_number_; |
scoped_ptr<LayerImpl> root_layer_; |
@@ -384,6 +374,7 @@ class CC_EXPORT LayerTreeImpl { |
typedef base::hash_map<int, LayerImpl*> LayerIdMap; |
LayerIdMap layer_id_map_; |
+ std::vector<PictureLayerImpl*> picture_layers_; |
std::vector<LayerImpl*> layers_with_copy_output_request_; |
// Persisted state for non-impl-side-painting. |
@@ -391,6 +382,9 @@ class CC_EXPORT LayerTreeImpl { |
// List of visible layers for the most recently prepared frame. |
LayerImplList render_surface_layer_list_; |
+ // After drawing the |render_surface_layer_list_| the areas in this region |
+ // would not be fully covered by opaque content. |
+ Region unoccluded_screen_space_region_; |
bool contents_textures_purged_; |
bool viewport_size_invalid_; |
@@ -416,11 +410,9 @@ class CC_EXPORT LayerTreeImpl { |
float top_controls_height_; |
- // The up-to-date content offset of the top controls, i.e. the amount that the |
- // web contents have been shifted down from the top of the device viewport. |
- float top_controls_content_offset_; |
- float top_controls_delta_; |
- float sent_top_controls_delta_; |
+ // The amount that the top controls are shown from 0 (hidden) to 1 (fully |
+ // shown). |
+ scoped_refptr<SyncedTopControls> top_controls_shown_ratio_; |
scoped_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; |