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

Side by Side Diff: sky/compositor/layer_host.h

Issue 826423008: Use local ids for Surfaces APIs that can only apply to local surfaces (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « services/view_manager/display_manager.cc ('k') | sky/compositor/layer_host.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 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 SKY_COMPOSITOR_LAYER_HOST_H_ 5 #ifndef SKY_COMPOSITOR_LAYER_HOST_H_
6 #define SKY_COMPOSITOR_LAYER_HOST_H_ 6 #define SKY_COMPOSITOR_LAYER_HOST_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 27 matching lines...) Expand all
38 return const_cast<ResourceManager*>(&resource_manager_); 38 return const_cast<ResourceManager*>(&resource_manager_);
39 } 39 }
40 40
41 void SetNeedsAnimate(); 41 void SetNeedsAnimate();
42 void SetRootLayer(scoped_refptr<Layer> layer); 42 void SetRootLayer(scoped_refptr<Layer> layer);
43 43
44 void GetPixelsForTesting(std::vector<unsigned char>* pixels); 44 void GetPixelsForTesting(std::vector<unsigned char>* pixels);
45 45
46 private: 46 private:
47 enum State { 47 enum State {
48 kWaitingForSurfaceService,
49 kReadyForFrame, 48 kReadyForFrame,
50 kWaitingForFrameAcknowldgement, 49 kWaitingForFrameAcknowldgement,
51 }; 50 };
52 51
53 // SurfaceHolder::Client 52 // SurfaceHolder::Client
54 void OnSurfaceConnectionCreated() override;
55 void OnSurfaceIdAvailable(mojo::SurfaceIdPtr surface_id) override; 53 void OnSurfaceIdAvailable(mojo::SurfaceIdPtr surface_id) override;
56 void ReturnResources( 54 void ReturnResources(
57 mojo::Array<mojo::ReturnedResourcePtr> resources) override; 55 mojo::Array<mojo::ReturnedResourcePtr> resources) override;
58 56
59 void BeginFrameSoon(); 57 void BeginFrameSoon();
60 void BeginFrame(); 58 void BeginFrame();
61 59
62 void Upload(Layer* layer); 60 void Upload(Layer* layer);
63 void DidCompleteFrame(); 61 void DidCompleteFrame();
64 62
65 LayerHostClient* client_; 63 LayerHostClient* client_;
66 State state_; 64 State state_;
67 bool frame_requested_; 65 bool frame_requested_;
68 SurfaceHolder surface_holder_; 66 SurfaceHolder surface_holder_;
69 mojo::GLContextOwner gl_context_owner_; 67 mojo::GLContextOwner gl_context_owner_;
70 mojo::GaneshContext ganesh_context_; 68 mojo::GaneshContext ganesh_context_;
71 ResourceManager resource_manager_; 69 ResourceManager resource_manager_;
72 scoped_refptr<Layer> root_layer_; 70 scoped_refptr<Layer> root_layer_;
73 71
74 base::WeakPtrFactory<LayerHost> weak_factory_; 72 base::WeakPtrFactory<LayerHost> weak_factory_;
75 73
76 DISALLOW_COPY_AND_ASSIGN(LayerHost); 74 DISALLOW_COPY_AND_ASSIGN(LayerHost);
77 }; 75 };
78 76
79 } // namespace sky 77 } // namespace sky
80 78
81 #endif // SKY_COMPOSITOR_LAYER_HOST_H_ 79 #endif // SKY_COMPOSITOR_LAYER_HOST_H_
OLDNEW
« no previous file with comments | « services/view_manager/display_manager.cc ('k') | sky/compositor/layer_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698