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

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

Issue 18191020: UI Resource Manager (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 5 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_IMPL_H_ 5 #ifndef CC_TREES_LAYER_TREE_HOST_IMPL_H_
6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_ 6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_
7 7
8 #include <list>
8 #include <string> 9 #include <string>
9 #include <vector> 10 #include <vector>
10 11
11 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/containers/hash_tables.h"
12 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
13 #include "base/time/time.h" 15 #include "base/time/time.h"
14 #include "cc/animation/animation_events.h" 16 #include "cc/animation/animation_events.h"
15 #include "cc/animation/animation_registrar.h" 17 #include "cc/animation/animation_registrar.h"
16 #include "cc/base/cc_export.h" 18 #include "cc/base/cc_export.h"
17 #include "cc/input/input_handler.h" 19 #include "cc/input/input_handler.h"
18 #include "cc/input/layer_scroll_offset_delegate.h" 20 #include "cc/input/layer_scroll_offset_delegate.h"
19 #include "cc/input/top_controls_manager_client.h" 21 #include "cc/input/top_controls_manager_client.h"
20 #include "cc/layers/layer_lists.h" 22 #include "cc/layers/layer_lists.h"
21 #include "cc/layers/render_pass_sink.h" 23 #include "cc/layers/render_pass_sink.h"
22 #include "cc/output/begin_frame_args.h" 24 #include "cc/output/begin_frame_args.h"
23 #include "cc/output/managed_memory_policy.h" 25 #include "cc/output/managed_memory_policy.h"
24 #include "cc/output/output_surface_client.h" 26 #include "cc/output/output_surface_client.h"
25 #include "cc/output/renderer.h" 27 #include "cc/output/renderer.h"
26 #include "cc/quads/render_pass.h" 28 #include "cc/quads/render_pass.h"
29 #include "cc/resources/resource_provider.h"
27 #include "cc/resources/tile_manager.h" 30 #include "cc/resources/tile_manager.h"
31 #include "skia/ext/refptr.h"
28 #include "third_party/skia/include/core/SkColor.h" 32 #include "third_party/skia/include/core/SkColor.h"
29 #include "ui/gfx/rect.h" 33 #include "ui/gfx/rect.h"
30 34
31 namespace cc { 35 namespace cc {
32 36
33 class CompletionEvent; 37 class CompletionEvent;
34 class CompositorFrameMetadata; 38 class CompositorFrameMetadata;
35 class DebugRectHistory; 39 class DebugRectHistory;
36 class FrameRateCounter; 40 class FrameRateCounter;
37 class LayerImpl; 41 class LayerImpl;
38 class LayerTreeHostImplTimeSourceAdapter; 42 class LayerTreeHostImplTimeSourceAdapter;
39 class LayerTreeImpl; 43 class LayerTreeImpl;
40 class PageScaleAnimation; 44 class PageScaleAnimation;
41 class PaintTimeCounter; 45 class PaintTimeCounter;
42 class MemoryHistory; 46 class MemoryHistory;
43 class RenderingStatsInstrumentation; 47 class RenderingStatsInstrumentation;
44 class RenderPassDrawQuad; 48 class RenderPassDrawQuad;
45 class ResourceProvider;
46 class TopControlsManager; 49 class TopControlsManager;
50 class UIResourceBitmap;
47 struct RendererCapabilities; 51 struct RendererCapabilities;
52 struct UIResourceRequest;
48 53
49 // LayerTreeHost->Proxy callback interface. 54 // LayerTreeHost->Proxy callback interface.
50 class LayerTreeHostImplClient { 55 class LayerTreeHostImplClient {
51 public: 56 public:
52 virtual void DidTryInitializeRendererOnImplThread( 57 virtual void DidTryInitializeRendererOnImplThread(
53 bool success, 58 bool success,
54 scoped_refptr<ContextProvider> offscreen_context_provider) = 0; 59 scoped_refptr<ContextProvider> offscreen_context_provider) = 0;
55 virtual void DidLoseOutputSurfaceOnImplThread() = 0; 60 virtual void DidLoseOutputSurfaceOnImplThread() = 0;
56 virtual void OnSwapBuffersCompleteOnImplThread() = 0; 61 virtual void OnSwapBuffersCompleteOnImplThread() = 0;
57 virtual void BeginFrameOnImplThread(const BeginFrameArgs& args) = 0; 62 virtual void BeginFrameOnImplThread(const BeginFrameArgs& args) = 0;
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 base::TimeTicks CurrentFrameTimeTicks(); 370 base::TimeTicks CurrentFrameTimeTicks();
366 base::Time CurrentFrameTime(); 371 base::Time CurrentFrameTime();
367 372
368 virtual base::TimeTicks CurrentPhysicalTimeTicks() const; 373 virtual base::TimeTicks CurrentPhysicalTimeTicks() const;
369 374
370 scoped_ptr<base::Value> AsValue() const; 375 scoped_ptr<base::Value> AsValue() const;
371 scoped_ptr<base::Value> ActivationStateAsValue() const; 376 scoped_ptr<base::Value> ActivationStateAsValue() const;
372 377
373 bool page_scale_animation_active() const { return !!page_scale_animation_; } 378 bool page_scale_animation_active() const { return !!page_scale_animation_; }
374 379
380 void CreateUIResource(UIResourceId uid,
381 scoped_refptr<UIResourceBitmap> bitmap);
382 // Deletes a UI resource. May safely be called more than once.
383 void DeleteUIResource(UIResourceId uid);
384
385 ResourceProvider::ResourceId ResourceIdForUIResource(UIResourceId uid) const;
386
375 protected: 387 protected:
376 LayerTreeHostImpl( 388 LayerTreeHostImpl(
377 const LayerTreeSettings& settings, 389 const LayerTreeSettings& settings,
378 LayerTreeHostImplClient* client, 390 LayerTreeHostImplClient* client,
379 Proxy* proxy, 391 Proxy* proxy,
380 RenderingStatsInstrumentation* rendering_stats_instrumentation); 392 RenderingStatsInstrumentation* rendering_stats_instrumentation);
381 virtual void ActivatePendingTree(); 393 virtual void ActivatePendingTree();
382 394
383 // Virtual for testing. 395 // Virtual for testing.
384 virtual void AnimateLayers(base::TimeTicks monotonic_time, 396 virtual void AnimateLayers(base::TimeTicks monotonic_time,
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 base::TimeTicks time); 446 base::TimeTicks time);
435 447
436 void UpdateCurrentFrameTime(base::TimeTicks* ticks, base::Time* now) const; 448 void UpdateCurrentFrameTime(base::TimeTicks* ticks, base::Time* now) const;
437 449
438 void StartScrollbarAnimationRecursive(LayerImpl* layer, base::TimeTicks time); 450 void StartScrollbarAnimationRecursive(LayerImpl* layer, base::TimeTicks time);
439 void SetManagedMemoryPolicy(const ManagedMemoryPolicy& policy); 451 void SetManagedMemoryPolicy(const ManagedMemoryPolicy& policy);
440 void EnforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy); 452 void EnforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy);
441 453
442 void DidInitializeVisibleTile(); 454 void DidInitializeVisibleTile();
443 455
456 typedef base::hash_map<UIResourceId, ResourceProvider::ResourceId>
457 UIResourceMap;
458 UIResourceMap ui_resource_map_;
459
444 scoped_ptr<OutputSurface> output_surface_; 460 scoped_ptr<OutputSurface> output_surface_;
445 461
446 // |resource_provider_| and |tile_manager_| can be NULL, e.g. when using tile- 462 // |resource_provider_| and |tile_manager_| can be NULL, e.g. when using tile-
447 // free rendering - see OutputSurface::ForcedDrawToSoftwareDevice(). 463 // free rendering - see OutputSurface::ForcedDrawToSoftwareDevice().
448 scoped_ptr<ResourceProvider> resource_provider_; 464 scoped_ptr<ResourceProvider> resource_provider_;
449 scoped_ptr<TileManager> tile_manager_; 465 scoped_ptr<TileManager> tile_manager_;
450 scoped_ptr<Renderer> renderer_; 466 scoped_ptr<Renderer> renderer_;
451 467
452 // Tree currently being drawn. 468 // Tree currently being drawn.
453 scoped_ptr<LayerTreeImpl> active_tree_; 469 scoped_ptr<LayerTreeImpl> active_tree_;
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 554
539 // Optional callback to notify of new tree activations. 555 // Optional callback to notify of new tree activations.
540 base::Closure tree_activation_callback_; 556 base::Closure tree_activation_callback_;
541 557
542 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); 558 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl);
543 }; 559 };
544 560
545 } // namespace cc 561 } // namespace cc
546 562
547 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ 563 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698