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

Side by Side Diff: cc/surfaces/display.h

Issue 432093003: Enqueuing new frames in a Surface should cause Displays to reaggregate it (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | cc/surfaces/display.cc » ('j') | cc/surfaces/surface_manager.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_SURFACES_DISPLAY_H_ 5 #ifndef CC_SURFACES_DISPLAY_H_
6 #define CC_SURFACES_DISPLAY_H_ 6 #define CC_SURFACES_DISPLAY_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "cc/output/output_surface_client.h" 9 #include "cc/output/output_surface_client.h"
10 #include "cc/output/renderer.h" 10 #include "cc/output/renderer.h"
11 #include "cc/resources/returned_resource.h" 11 #include "cc/resources/returned_resource.h"
12 #include "cc/surfaces/surface_aggregator.h" 12 #include "cc/surfaces/surface_aggregator.h"
13 #include "cc/surfaces/surface_id.h" 13 #include "cc/surfaces/surface_id.h"
14 #include "cc/surfaces/surface_manager.h"
14 #include "cc/surfaces/surfaces_export.h" 15 #include "cc/surfaces/surfaces_export.h"
15 16
16 namespace gfx { 17 namespace gfx {
17 class Size; 18 class Size;
18 } 19 }
19 20
20 namespace cc { 21 namespace cc {
21 22
22 class DirectRenderer; 23 class DirectRenderer;
23 class DisplayClient; 24 class DisplayClient;
24 class OutputSurface; 25 class OutputSurface;
25 class ResourceProvider; 26 class ResourceProvider;
26 class SharedBitmapManager; 27 class SharedBitmapManager;
27 class Surface; 28 class Surface;
28 class SurfaceAggregator; 29 class SurfaceAggregator;
29 class SurfaceIdAllocator; 30 class SurfaceIdAllocator;
30 class SurfaceFactory; 31 class SurfaceFactory;
31 class SurfaceManager;
32 32
33 // A Display produces a surface that can be used to draw to a physical display 33 // A Display produces a surface that can be used to draw to a physical display
34 // (OutputSurface). The client is responsible for creating and sizing the 34 // (OutputSurface). The client is responsible for creating and sizing the
35 // surface IDs used to draw into the display and deciding when to draw. 35 // surface IDs used to draw into the display and deciding when to draw.
36 class CC_SURFACES_EXPORT Display : public OutputSurfaceClient, 36 class CC_SURFACES_EXPORT Display
37 public RendererClient { 37 : public OutputSurfaceClient,
38 public RendererClient,
39 public SurfaceManager::SurfaceDamageObserver {
38 public: 40 public:
39 Display(DisplayClient* client, 41 Display(DisplayClient* client,
40 SurfaceManager* manager, 42 SurfaceManager* manager,
41 SharedBitmapManager* bitmap_manager); 43 SharedBitmapManager* bitmap_manager);
42 virtual ~Display(); 44 virtual ~Display();
43 45
44 void Resize(SurfaceId id, const gfx::Size& new_size); 46 void Resize(SurfaceId id, const gfx::Size& new_size);
45 bool Draw(); 47 bool Draw();
46 48
47 SurfaceId CurrentSurfaceId(); 49 SurfaceId CurrentSurfaceId();
(...skipping 17 matching lines...) Expand all
65 const gfx::Transform& transform_for_tile_priority, 67 const gfx::Transform& transform_for_tile_priority,
66 bool resourceless_software_draw) OVERRIDE {} 68 bool resourceless_software_draw) OVERRIDE {}
67 virtual void SetMemoryPolicy(const ManagedMemoryPolicy& policy) OVERRIDE {} 69 virtual void SetMemoryPolicy(const ManagedMemoryPolicy& policy) OVERRIDE {}
68 virtual void SetTreeActivationCallback( 70 virtual void SetTreeActivationCallback(
69 const base::Closure& callback) OVERRIDE {} 71 const base::Closure& callback) OVERRIDE {}
70 72
71 // RendererClient implementation. 73 // RendererClient implementation.
72 virtual void SetFullRootLayerDamage() OVERRIDE {} 74 virtual void SetFullRootLayerDamage() OVERRIDE {}
73 virtual void RunOnDemandRasterTask(Task* on_demand_raster_task) OVERRIDE {} 75 virtual void RunOnDemandRasterTask(Task* on_demand_raster_task) OVERRIDE {}
74 76
77 // SurfaceManager::SurfaceDamageObserver implementation.
78 virtual void OnSurfaceDamaged(SurfaceId surface) OVERRIDE;
79
75 private: 80 private:
76 void InitializeOutputSurface(); 81 void InitializeOutputSurface();
77 82
78 DisplayClient* client_; 83 DisplayClient* client_;
79 SurfaceManager* manager_; 84 SurfaceManager* manager_;
80 SharedBitmapManager* bitmap_manager_; 85 SharedBitmapManager* bitmap_manager_;
81 SurfaceId current_surface_id_; 86 SurfaceId current_surface_id_;
82 gfx::Size current_surface_size_; 87 gfx::Size current_surface_size_;
83 LayerTreeSettings settings_; 88 LayerTreeSettings settings_;
84 scoped_ptr<OutputSurface> output_surface_; 89 scoped_ptr<OutputSurface> output_surface_;
85 scoped_ptr<ResourceProvider> resource_provider_; 90 scoped_ptr<ResourceProvider> resource_provider_;
86 scoped_ptr<SurfaceAggregator> aggregator_; 91 scoped_ptr<SurfaceAggregator> aggregator_;
87 scoped_ptr<DirectRenderer> renderer_; 92 scoped_ptr<DirectRenderer> renderer_;
88 93
94 std::set<SurfaceId> contained_surfaces_;
95
89 DISALLOW_COPY_AND_ASSIGN(Display); 96 DISALLOW_COPY_AND_ASSIGN(Display);
90 }; 97 };
91 98
92 } // namespace cc 99 } // namespace cc
93 100
94 #endif // CC_SURFACES_DISPLAY_H_ 101 #endif // CC_SURFACES_DISPLAY_H_
OLDNEW
« no previous file with comments | « no previous file | cc/surfaces/display.cc » ('j') | cc/surfaces/surface_manager.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698