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

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

Issue 1982893002: [blimp] Add SkPicture caching support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix non-existing SkPicture::uniqueID() when dealing with display items without SkPictures Created 4 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
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 <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 16 matching lines...) Expand all
27 #include "cc/input/event_listener_properties.h" 27 #include "cc/input/event_listener_properties.h"
28 #include "cc/input/input_handler.h" 28 #include "cc/input/input_handler.h"
29 #include "cc/input/layer_selection_bound.h" 29 #include "cc/input/layer_selection_bound.h"
30 #include "cc/input/scrollbar.h" 30 #include "cc/input/scrollbar.h"
31 #include "cc/input/top_controls_state.h" 31 #include "cc/input/top_controls_state.h"
32 #include "cc/layers/layer_collections.h" 32 #include "cc/layers/layer_collections.h"
33 #include "cc/layers/layer_list_iterator.h" 33 #include "cc/layers/layer_list_iterator.h"
34 #include "cc/output/output_surface.h" 34 #include "cc/output/output_surface.h"
35 #include "cc/output/renderer_capabilities.h" 35 #include "cc/output/renderer_capabilities.h"
36 #include "cc/output/swap_promise.h" 36 #include "cc/output/swap_promise.h"
37 #include "cc/proto/picture_cache.h"
37 #include "cc/resources/resource_format.h" 38 #include "cc/resources/resource_format.h"
38 #include "cc/resources/scoped_ui_resource.h" 39 #include "cc/resources/scoped_ui_resource.h"
39 #include "cc/surfaces/surface_sequence.h" 40 #include "cc/surfaces/surface_sequence.h"
40 #include "cc/trees/compositor_mode.h" 41 #include "cc/trees/compositor_mode.h"
41 #include "cc/trees/layer_tree_host_client.h" 42 #include "cc/trees/layer_tree_host_client.h"
42 #include "cc/trees/layer_tree_settings.h" 43 #include "cc/trees/layer_tree_settings.h"
43 #include "cc/trees/mutator_host_client.h" 44 #include "cc/trees/mutator_host_client.h"
44 #include "cc/trees/proxy.h" 45 #include "cc/trees/proxy.h"
45 #include "cc/trees/swap_promise_monitor.h" 46 #include "cc/trees/swap_promise_monitor.h"
46 #include "third_party/skia/include/core/SkColor.h" 47 #include "third_party/skia/include/core/SkColor.h"
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 bool IsSingleThreaded() const; 415 bool IsSingleThreaded() const;
415 bool IsThreaded() const; 416 bool IsThreaded() const;
416 bool IsRemoteServer() const; 417 bool IsRemoteServer() const;
417 bool IsRemoteClient() const; 418 bool IsRemoteClient() const;
418 void BuildPropertyTreesForTesting(); 419 void BuildPropertyTreesForTesting();
419 420
420 ImageSerializationProcessor* image_serialization_processor() const { 421 ImageSerializationProcessor* image_serialization_processor() const {
421 return image_serialization_processor_; 422 return image_serialization_processor_;
422 } 423 }
423 424
425 EnginePictureCache* engine_picture_cache() const {
426 return engine_picture_cache_ ? engine_picture_cache_.get() : nullptr;
427 }
428
429 ClientPictureCache* client_picture_cache() const {
430 return client_picture_cache_ ? client_picture_cache_.get() : nullptr;
431 }
432
424 protected: 433 protected:
425 LayerTreeHost(InitParams* params, CompositorMode mode); 434 LayerTreeHost(InitParams* params, CompositorMode mode);
426 void InitializeThreaded( 435 void InitializeThreaded(
427 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, 436 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
428 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, 437 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner,
429 std::unique_ptr<BeginFrameSource> external_begin_frame_source); 438 std::unique_ptr<BeginFrameSource> external_begin_frame_source);
430 void InitializeSingleThreaded( 439 void InitializeSingleThreaded(
431 LayerTreeHostSingleThreadClient* single_thread_client, 440 LayerTreeHostSingleThreadClient* single_thread_client,
432 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, 441 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
433 std::unique_ptr<BeginFrameSource> external_begin_frame_source); 442 std::unique_ptr<BeginFrameSource> external_begin_frame_source);
434 void InitializeRemoteServer( 443 void InitializeRemoteServer(
435 RemoteProtoChannel* remote_proto_channel, 444 RemoteProtoChannel* remote_proto_channel,
436 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); 445 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner);
437 void InitializeRemoteClient( 446 void InitializeRemoteClient(
438 RemoteProtoChannel* remote_proto_channel, 447 RemoteProtoChannel* remote_proto_channel,
439 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, 448 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
440 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); 449 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner);
441 void InitializeForTesting( 450 void InitializeForTesting(
442 std::unique_ptr<TaskRunnerProvider> task_runner_provider, 451 std::unique_ptr<TaskRunnerProvider> task_runner_provider,
443 std::unique_ptr<Proxy> proxy_for_testing, 452 std::unique_ptr<Proxy> proxy_for_testing,
444 std::unique_ptr<BeginFrameSource> external_begin_frame_source); 453 std::unique_ptr<BeginFrameSource> external_begin_frame_source);
454 void InitializePictureCacheForTesting();
445 void SetOutputSurfaceLostForTesting(bool is_lost) { 455 void SetOutputSurfaceLostForTesting(bool is_lost) {
446 output_surface_lost_ = is_lost; 456 output_surface_lost_ = is_lost;
447 } 457 }
448 void SetTaskRunnerProviderForTesting( 458 void SetTaskRunnerProviderForTesting(
449 std::unique_ptr<TaskRunnerProvider> task_runner_provider); 459 std::unique_ptr<TaskRunnerProvider> task_runner_provider);
450 460
451 // shared_bitmap_manager(), gpu_memory_buffer_manager(), and 461 // shared_bitmap_manager(), gpu_memory_buffer_manager(), and
452 // task_graph_runner() return valid values only until the LayerTreeHostImpl is 462 // task_graph_runner() return valid values only until the LayerTreeHostImpl is
453 // created in CreateLayerTreeHostImpl(). 463 // created in CreateLayerTreeHostImpl().
454 SharedBitmapManager* shared_bitmap_manager() const { 464 SharedBitmapManager* shared_bitmap_manager() const {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 scoped_refptr<Layer> inner_viewport_scroll_layer_; 578 scoped_refptr<Layer> inner_viewport_scroll_layer_;
569 scoped_refptr<Layer> outer_viewport_scroll_layer_; 579 scoped_refptr<Layer> outer_viewport_scroll_layer_;
570 580
571 LayerSelection selection_; 581 LayerSelection selection_;
572 582
573 SharedBitmapManager* shared_bitmap_manager_; 583 SharedBitmapManager* shared_bitmap_manager_;
574 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; 584 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_;
575 TaskGraphRunner* task_graph_runner_; 585 TaskGraphRunner* task_graph_runner_;
576 586
577 ImageSerializationProcessor* image_serialization_processor_; 587 ImageSerializationProcessor* image_serialization_processor_;
588 std::unique_ptr<EnginePictureCache> engine_picture_cache_;
589 std::unique_ptr<ClientPictureCache> client_picture_cache_;
578 590
579 std::vector<std::unique_ptr<SwapPromise>> swap_promise_list_; 591 std::vector<std::unique_ptr<SwapPromise>> swap_promise_list_;
580 std::set<SwapPromiseMonitor*> swap_promise_monitor_; 592 std::set<SwapPromiseMonitor*> swap_promise_monitor_;
581 593
582 PropertyTrees property_trees_; 594 PropertyTrees property_trees_;
583 595
584 using LayerIdMap = std::unordered_map<int, Layer*>; 596 using LayerIdMap = std::unordered_map<int, Layer*>;
585 LayerIdMap layer_id_map_; 597 LayerIdMap layer_id_map_;
586 // Set of layers that need to push properties. 598 // Set of layers that need to push properties.
587 std::unordered_set<Layer*> layers_that_should_push_properties_; 599 std::unordered_set<Layer*> layers_that_should_push_properties_;
588 600
589 uint32_t surface_id_namespace_; 601 uint32_t surface_id_namespace_;
590 uint32_t next_surface_sequence_; 602 uint32_t next_surface_sequence_;
591 603
592 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); 604 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost);
593 }; 605 };
594 606
595 } // namespace cc 607 } // namespace cc
596 608
597 #endif // CC_TREES_LAYER_TREE_HOST_H_ 609 #endif // CC_TREES_LAYER_TREE_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698