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

Side by Side Diff: cc/layers/layer.h

Issue 2493523003: cc: Remove unused proto conversion code. (Closed)
Patch Set: test Created 4 years, 1 month 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
« no previous file with comments | « cc/blimp/layer_tree_host_unittest_serialization.cc ('k') | cc/layers/layer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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_LAYERS_LAYER_H_ 5 #ifndef CC_LAYERS_LAYER_H_
6 #define CC_LAYERS_LAYER_H_ 6 #define CC_LAYERS_LAYER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 // //cc/proto/layer.pb.h in this header file, as it requires that all 351 // //cc/proto/layer.pb.h in this header file, as it requires that all
352 // dependent targets would have to be given the config for how to include it. 352 // dependent targets would have to be given the config for how to include it.
353 virtual void SetTypeForProtoSerialization(proto::LayerNode* proto) const; 353 virtual void SetTypeForProtoSerialization(proto::LayerNode* proto) const;
354 354
355 // Recursively iterate over this layer and all children and write the 355 // Recursively iterate over this layer and all children and write the
356 // hierarchical structure to the given LayerNode proto. In addition to the 356 // hierarchical structure to the given LayerNode proto. In addition to the
357 // structure itself, the Layer id and type is also written to facilitate 357 // structure itself, the Layer id and type is also written to facilitate
358 // construction of the correct layer on the client. 358 // construction of the correct layer on the client.
359 virtual void ToLayerNodeProto(proto::LayerNode* proto) const; 359 virtual void ToLayerNodeProto(proto::LayerNode* proto) const;
360 360
361 // Recursively iterate over this layer and all children and reset the
362 // properties sent with the hierarchical structure in the LayerNode protos.
363 // This must be done before deserializing the new LayerTree from the Layernode
364 // protos.
365 void ClearLayerTreePropertiesForDeserializationAndAddToMap(
366 LayerIdMap* layer_map);
367
368 // Recursively iterate over the given LayerNode proto and read the structure
369 // into this node and its children. The |layer_map| should be used to look
370 // for previously existing Layers, since they should be re-used between each
371 // hierarchy update.
372 virtual void FromLayerNodeProto(const proto::LayerNode& proto,
373 const LayerIdMap& layer_map,
374 LayerTreeHost* layer_tree_host);
375
376 // This method is similar to PushPropertiesTo, but instead of pushing to 361 // This method is similar to PushPropertiesTo, but instead of pushing to
377 // a LayerImpl, it pushes the properties to proto::LayerProperties. It is 362 // a LayerImpl, it pushes the properties to proto::LayerProperties. It is
378 // called only on layers that have changed properties. The properties 363 // called only on layers that have changed properties. The properties
379 // themselves are pushed to proto::LayerProperties. 364 // themselves are pushed to proto::LayerProperties.
380 virtual void ToLayerPropertiesProto(proto::LayerUpdate* layer_update, 365 virtual void ToLayerPropertiesProto(proto::LayerProperties* proto);
381 bool inputs_only);
382
383 // Read all property values from the given LayerProperties object and update
384 // the current layer. The values for |needs_push_properties_| and
385 // |num_dependents_need_push_properties_| are always updated, but the rest
386 // of |proto| is only read if |needs_push_properties_| is set.
387 void FromLayerPropertiesProto(const proto::LayerProperties& proto);
388 366
389 LayerTreeHost* GetLayerTreeHostForTesting() const { return layer_tree_host_; } 367 LayerTreeHost* GetLayerTreeHostForTesting() const { return layer_tree_host_; }
390 LayerTree* GetLayerTree() const; 368 LayerTree* GetLayerTree() const;
391 369
392 virtual ScrollbarLayerInterface* ToScrollbarLayer(); 370 virtual ScrollbarLayerInterface* ToScrollbarLayer();
393 371
394 virtual sk_sp<SkPicture> GetPicture() const; 372 virtual sk_sp<SkPicture> GetPicture() const;
395 373
396 // Constructs a LayerImpl of the correct runtime type for this Layer type. 374 // Constructs a LayerImpl of the correct runtime type for this Layer type.
397 virtual std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl); 375 virtual std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl);
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 MutatorHost* GetMutatorHost() const; 475 MutatorHost* GetMutatorHost() const;
498 476
499 ElementListType GetElementTypeForAnimation() const; 477 ElementListType GetElementTypeForAnimation() const;
500 478
501 // Tests in remote mode need to explicitly set the layer id so it matches the 479 // Tests in remote mode need to explicitly set the layer id so it matches the
502 // layer id for the corresponding Layer on the engine. 480 // layer id for the corresponding Layer on the engine.
503 void SetLayerIdForTesting(int id); 481 void SetLayerIdForTesting(int id);
504 482
505 void SetScrollbarsHiddenFromImplSide(bool hidden); 483 void SetScrollbarsHiddenFromImplSide(bool hidden);
506 484
485 const gfx::Rect& update_rect() const { return inputs_.update_rect; }
486
507 protected: 487 protected:
508 friend class LayerImpl; 488 friend class LayerImpl;
509 friend class TreeSynchronizer; 489 friend class TreeSynchronizer;
510 virtual ~Layer(); 490 virtual ~Layer();
511 Layer(); 491 Layer();
512 492
513 LayerTreeHost* layer_tree_host() { return layer_tree_host_; } 493 LayerTreeHost* layer_tree_host() { return layer_tree_host_; }
514 494
515 // These SetNeeds functions are in order of severity of update: 495 // These SetNeeds functions are in order of severity of update:
516 // 496 //
(...skipping 20 matching lines...) Expand all
537 // Will recalculate whether the layer draws content and set draws_content_ 517 // Will recalculate whether the layer draws content and set draws_content_
538 // appropriately. 518 // appropriately.
539 void UpdateDrawsContent(bool has_drawable_content); 519 void UpdateDrawsContent(bool has_drawable_content);
540 virtual bool HasDrawableContent() const; 520 virtual bool HasDrawableContent() const;
541 521
542 // Called when the layer's number of drawable descendants changes. 522 // Called when the layer's number of drawable descendants changes.
543 void AddDrawableDescendants(int num); 523 void AddDrawableDescendants(int num);
544 524
545 bool IsPropertyChangeAllowed() const; 525 bool IsPropertyChangeAllowed() const;
546 526
547 // Serialize all the necessary properties to be able to reconstruct this Layer
548 // into proto::LayerProperties. This method is not marked as const
549 // as some implementations need reset member fields, similarly to
550 // PushPropertiesTo().
551 virtual void LayerSpecificPropertiesToProto(proto::LayerProperties* proto,
552 bool inputs_only);
553
554 // Deserialize all the necessary properties from proto::LayerProperties into
555 // this Layer.
556 virtual void FromLayerSpecificPropertiesProto(
557 const proto::LayerProperties& proto);
558
559 gfx::Rect& update_rect() { return inputs_.update_rect; }
560
561 // When true, the layer is about to perform an update. Any commit requests 527 // When true, the layer is about to perform an update. Any commit requests
562 // will be handled implicitly after the update completes. 528 // will be handled implicitly after the update completes.
563 bool ignore_set_needs_commit_; 529 bool ignore_set_needs_commit_;
564 530
565 private: 531 private:
566 friend class base::RefCounted<Layer>; 532 friend class base::RefCounted<Layer>;
567 friend class LayerSerializationTest;
568 friend class LayerTreeHostCommon; 533 friend class LayerTreeHostCommon;
569 friend class LayerTreeHost;
570 friend class LayerTree; 534 friend class LayerTree;
571 friend class LayerInternalsForTest; 535 friend class LayerInternalsForTest;
572 536
573 // Interactions with attached animations. 537 // Interactions with attached animations.
574 gfx::ScrollOffset ScrollOffsetForAnimation() const; 538 gfx::ScrollOffset ScrollOffsetForAnimation() const;
575 void OnFilterAnimated(const FilterOperations& filters); 539 void OnFilterAnimated(const FilterOperations& filters);
576 void OnOpacityAnimated(float opacity); 540 void OnOpacityAnimated(float opacity);
577 void OnTransformAnimated(const gfx::Transform& transform); 541 void OnTransformAnimated(const gfx::Transform& transform);
578 void OnScrollOffsetAnimated(const gfx::ScrollOffset& scroll_offset); 542 void OnScrollOffsetAnimated(const gfx::ScrollOffset& scroll_offset);
579 543
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 // These all act like draw properties, so don't need push properties. 702 // These all act like draw properties, so don't need push properties.
739 gfx::Rect visible_layer_rect_; 703 gfx::Rect visible_layer_rect_;
740 size_t num_unclipped_descendants_; 704 size_t num_unclipped_descendants_;
741 705
742 DISALLOW_COPY_AND_ASSIGN(Layer); 706 DISALLOW_COPY_AND_ASSIGN(Layer);
743 }; 707 };
744 708
745 } // namespace cc 709 } // namespace cc
746 710
747 #endif // CC_LAYERS_LAYER_H_ 711 #endif // CC_LAYERS_LAYER_H_
OLDNEW
« no previous file with comments | « cc/blimp/layer_tree_host_unittest_serialization.cc ('k') | cc/layers/layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698