Home | History | Annotate | Download | only in layers

Lines Matching refs:layer

5 #include "cc/layers/layer.h"
30 scoped_refptr<Layer> Layer::Create() {
31 return make_scoped_refptr(new Layer());
34 Layer::Layer()
79 Layer::~Layer() {
83 // Similarly we shouldn't have a layer tree host since it also keeps a
105 void Layer::SetLayerTreeHost(LayerTreeHost* host) {
111 // When changing hosts, the layer needs to commit its properties to the impl
136 void Layer::SetNeedsUpdate() {
141 void Layer::SetNeedsCommit() {
153 void Layer::SetNeedsFullTreeSync() {
160 void Layer::SetNextCommitWaitsForActivation() {
167 void Layer::SetNeedsFilterContextIfNeeded() {
176 void Layer::SetNeedsPushProperties() {
184 void Layer::AddDependentNeedsPushProperties() {
193 void Layer::RemoveDependentNeedsPushProperties() {
201 bool Layer::IsPropertyChangeAllowed() const {
211 gfx::Rect Layer::LayerRectToContentRect(const gfx::RectF& layer_rect) const {
220 skia::RefPtr<SkPicture> Layer::GetPicture() const {
224 void Layer::SetParent(Layer* layer) {
225 DCHECK(!layer || !layer->HasAncestor(this));
230 if (layer)
231 layer->AddDependentNeedsPushProperties();
234 parent_ = layer;
250 void Layer::AddChild(scoped_refptr<Layer> child) {
254 void Layer::InsertChild(scoped_refptr<Layer> child, size_t index) {
265 void Layer::RemoveFromParent() {
271 void Layer::RemoveChildOrDependent(Layer* child) {
298 void Layer::ReplaceChild(Layer* reference, scoped_refptr<Layer> new_layer) {
320 int Layer::IndexOfChild(const Layer* reference) {
328 void Layer::SetBounds(gfx::Size size) {
337 Layer* Layer::RootLayer() {
338 Layer* layer = this;
339 while (layer->parent())
340 layer = layer->parent();
341 return layer;
344 void Layer::RemoveAllChildren() {
347 Layer* layer = children_[0].get();
348 DCHECK_EQ(this, layer->parent());
349 layer->RemoveFromParent();
353 void Layer::SetChildren(const LayerList& children) {
363 bool Layer::HasAncestor(const Layer* ancestor) const {
364 for (const Layer* layer = parent(); layer; layer = layer->parent()) {
365 if (layer == ancestor)
371 void Layer::RequestCopyOfOutput(
380 void Layer::SetAnchorPoint(gfx::PointF anchor_point) {
388 void Layer::SetAnchorPointZ(float anchor_point_z) {
396 void Layer::SetBackgroundColor(SkColor background_color) {
404 SkColor Layer::SafeOpaqueBackgroundColor() const {
409 for (const Layer* layer = parent(); layer;
410 layer = layer->parent()) {
411 color = layer->background_color();
423 void Layer::CalculateContentsScale(
438 void Layer::SetMasksToBounds(bool masks_to_bounds) {
446 void Layer::SetMaskLayer(Layer* mask_layer) {
464 void Layer::SetReplicaLayer(Layer* layer) {
466 if (replica_layer_.get() == layer)
472 replica_layer_ = layer;
481 void Layer::SetFilters(const FilterOperations& filters) {
490 bool Layer::FilterIsAnimating() const {
494 void Layer::SetBackgroundFilters(const FilterOperations& filters) {
503 void Layer::SetOpacity(float opacity) {
511 bool Layer::OpacityIsAnimating() const {
515 bool Layer::OpacityCanAnimateOnImplThread() const {
519 void Layer::SetBlendMode(SkXfermode::Mode blend_mode) {
569 void Layer::SetIsRootForIsolatedGroup(bool root) {
577 void Layer::SetContentsOpaque(bool opaque) {
585 void Layer::SetPosition(gfx::PointF position) {
593 bool Layer::IsContainerForFixedPositionLayers() const {
601 void Layer::SetSublayerTransform(const gfx::Transform& sublayer_transform) {
609 void Layer::SetTransform(const gfx::Transform& transform) {
617 bool Layer::TransformIsAnimating() const {
621 void Layer::SetScrollParent(Layer* parent) {
637 void Layer::AddScrollChild(Layer* child) {
639 scroll_children_.reset(new std::set<Layer*>);
644 void Layer::RemoveScrollChild(Layer* child) {
651 void Layer::SetClipParent(Layer* ancestor) {
667 void Layer::AddClipChild(Layer* child) {
669 clip_children_.reset(new std::set<Layer*>);
674 void Layer::RemoveClipChild(Layer* child) {
681 void Layer::SetScrollOffset(gfx::Vector2d scroll_offset) {
689 void Layer::SetScrollOffsetFromImplSide(gfx::Vector2d scroll_offset) {
700 // The callback could potentially change the layer structure:
704 void Layer::SetMaxScrollOffset(gfx::Vector2d max_scroll_offset) {
712 void Layer::SetScrollable(bool scrollable) {
720 void Layer::SetUserScrollable(bool horizontal, bool vertical) {
730 void Layer::SetShouldScrollOnMainThread(bool should_scroll_on_main_thread) {
738 void Layer::SetHaveWheelEventHandlers(bool have_wheel_event_handlers) {
746 void Layer::SetNonFastScrollableRegion(const Region& region) {
754 void Layer::SetTouchEventHandlerRegion(const Region& region) {
762 void Layer::SetDrawCheckerboardForMissingTiles(bool checkerboard) {
770 void Layer::SetForceRenderSurface(bool force) {
778 void Layer::SetDoubleSided(bool double_sided) {
786 void Layer::SetIsDrawable(bool is_drawable) {
795 void Layer::SetHideLayerAndSubtree(bool hide) {
804 void Layer::SetNeedsDisplayRect(const gfx::RectF& dirty_rect) {
815 bool Layer::DescendantIsFixedToContainerLayer() const {
824 void Layer::SetIsContainerForFixedPositionLayers(bool container) {
837 void Layer::SetPositionConstraint(const LayerPositionConstraint& constraint) {
860 void Layer::PushPropertiesTo(LayerImpl* layer) {
863 // If we did not SavePaintProperties() for the layer this frame, then push the
868 layer->SetAnchorPoint(anchor_point_);
869 layer->SetAnchorPointZ(anchor_point_z_);
870 layer->SetBackgroundColor(background_color_);
871 layer->SetBounds(use_paint_properties ? paint_properties_.bounds
873 layer->SetContentBounds(content_bounds());
874 layer->SetContentsScale(contents_scale_x(), contents_scale_y());
880 layer->SetDebugName(DebugName());
881 layer->SetDebugInfo(TakeDebugInfo());
883 layer->SetDebugName(std::string());
886 layer->SetCompositingReasons(compositing_reasons_);
887 layer->SetDoubleSided(double_sided_);
888 layer->SetDrawCheckerboardForMissingTiles(
890 layer->SetForceRenderSurface(force_render_surface_);
891 layer->SetDrawsContent(DrawsContent());
892 layer->SetHideLayerAndSubtree(hide_layer_and_subtree_);
893 if (!layer->FilterIsAnimatingOnImplOnly() && !FilterIsAnimating())
894 layer->SetFilters(filters_);
895 DCHECK(!(FilterIsAnimating() && layer->FilterIsAnimatingOnImplOnly()));
896 layer->SetBackgroundFilters(background_filters());
897 layer->SetMasksToBounds(masks_to_bounds_);
898 layer->SetShouldScrollOnMainThread(should_scroll_on_main_thread_);
899 layer->SetHaveWheelEventHandlers(have_wheel_event_handlers_);
900 layer->SetNonFastScrollableRegion(non_fast_scrollable_region_);
901 layer->SetTouchEventHandlerRegion(touch_event_handler_region_);
902 layer->SetContentsOpaque(contents_opaque_);
903 if (!layer->OpacityIsAnimatingOnImplOnly() && !OpacityIsAnimating())
904 layer->SetOpacity(opacity_);
905 DCHECK(!(OpacityIsAnimating() && layer->OpacityIsAnimatingOnImplOnly()));
906 layer->SetBlendMode(blend_mode_);
907 layer->SetIsRootForIsolatedGroup(is_root_for_isolated_group_);
908 layer->SetPosition(position_);
909 layer->SetIsContainerForFixedPositionLayers(
911 layer->SetFixedContainerSizeDelta(gfx::Vector2dF());
912 layer->SetPositionConstraint(position_constraint_);
913 layer->SetPreserves3d(preserves_3d());
914 layer->SetUseParentBackfaceVisibility(use_parent_backface_visibility_);
915 layer->SetSublayerTransform(sublayer_transform_);
916 if (!layer->TransformIsAnimatingOnImplOnly() && !TransformIsAnimating())
917 layer->SetTransform(transform_);
918 DCHECK(!(TransformIsAnimating() && layer->TransformIsAnimatingOnImplOnly()));
920 layer->SetScrollable(scrollable_);
921 layer->set_user_scrollable_horizontal(user_scrollable_horizontal_);
922 layer->set_user_scrollable_vertical(user_scrollable_vertical_);
923 layer->SetMaxScrollOffset(max_scroll_offset_);
927 scroll_parent = layer->layer_tree_impl()->LayerById(scroll_parent_->id());
929 layer->SetScrollParent(scroll_parent);
932 for (std::set<Layer*>::iterator it = scroll_children_->begin();
934 scroll_children->insert(layer->layer_tree_impl()->LayerById((*it)->id()));
935 layer->SetScrollChildren(scroll_children);
941 layer->layer_tree_impl()->LayerById(clip_parent_->id());
944 layer->SetClipParent(clip_parent);
947 for (std::set<Layer*>::iterator it = clip_children_->begin();
949 LayerImpl* clip_child = layer->layer_tree_impl()->LayerById((*it)->id());
953 layer->SetClipChildren(clip_children);
959 if (layer->layer_tree_impl()->settings().impl_side_painting) {
960 layer->SetScrollOffset(scroll_offset_);
962 layer->SetScrollOffsetAndDelta(
963 scroll_offset_, layer->ScrollDelta() - layer->sent_scroll_delta());
964 layer->SetSentScrollDelta(gfx::Vector2d());
985 layer->PassCopyRequests(&main_thread_copy_requests);
991 update_rect_.Union(layer->update_rect());
992 layer->set_update_rect(update_rect_);
994 layer->SetStackingOrderChanged(stacking_order_changed_);
997 layer->layer_animation_controller());
1007 scoped_ptr<LayerImpl> Layer::CreateLayerImpl(LayerTreeImpl* tree_impl) {
1011 bool Layer::DrawsContent() const {
1015 void Layer::SavePaintProperties() {
1018 // TODO(reveman): Save all layer properties that we depend on not
1025 bool Layer::Update(ResourceUpdateQueue* queue,
1030 "SavePaintProperties must be called for any layer that is painted.";
1034 bool Layer::NeedMoreUpdates() {
1038 std::string Layer::DebugName() {
1042 scoped_refptr<base::debug::ConvertableToTraceFormat> Layer::TakeDebugInfo() {
1050 void Layer::SetCompositingReasons(CompositingReasons reasons) {
1054 void Layer::CreateRenderSurface() {
1060 void Layer::ClearRenderSurface() {
1064 gfx::Vector2dF Layer::ScrollOffsetForAnimation() const {
1072 void Layer::OnFilterAnimated(const FilterOperations& filters) {
1076 void Layer::OnOpacityAnimated(float opacity) {
1080 void Layer::OnTransformAnimated(const gfx::Transform& transform) {
1084 void Layer::OnScrollOffsetAnimated(gfx::Vector2dF scroll_offset) {
1090 void Layer::OnAnimationWaitingForDeletion() {
1095 bool Layer::IsActive() const {
1099 bool Layer::AddAnimation(scoped_ptr <Animation> animation) {
1110 void Layer::PauseAnimation(int animation_id, double time_offset) {
1115 void Layer::RemoveAnimation(int animation_id) {
1120 void Layer::SetLayerAnimationControllerForTest(
1128 bool Layer::HasActiveAnimation() const {
1132 void Layer::AddLayerAnimationEventObserver(
1137 void Layer::RemoveLayerAnimationEventObserver(
1142 Region Layer::VisibleContentOpaqueRegion() const {
1148 ScrollbarLayerInterface* Layer::ToScrollbarLayer() {
1152 RenderingStatsInstrumentation* Layer::rendering_stats_instrumentation() const {
1156 bool Layer::SupportsLCDText() const {
1160 void Layer::RemoveFromScrollTree() {
1162 for (std::set<Layer*>::iterator it = scroll_children_->begin();
1173 void Layer::RemoveFromClipTree() {
1175 for (std::set<Layer*>::iterator it = clip_children_->begin();
1186 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) {