OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_OUTPUT_OUTPUT_SURFACE_H_ | 5 #ifndef CC_OUTPUT_OUTPUT_SURFACE_H_ |
6 #define CC_OUTPUT_OUTPUT_SURFACE_H_ | 6 #define CC_OUTPUT_OUTPUT_SURFACE_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "base/threading/thread_checker.h" | |
14 #include "cc/base/cc_export.h" | 15 #include "cc/base/cc_export.h" |
15 #include "cc/output/context_provider.h" | 16 #include "cc/output/context_provider.h" |
16 #include "cc/output/overlay_candidate_validator.h" | 17 #include "cc/output/overlay_candidate_validator.h" |
17 #include "cc/output/software_output_device.h" | 18 #include "cc/output/software_output_device.h" |
18 | 19 |
19 namespace base { class SingleThreadTaskRunner; } | 20 namespace base { class SingleThreadTaskRunner; } |
20 | 21 |
21 namespace ui { | 22 namespace ui { |
22 class LatencyInfo; | 23 class LatencyInfo; |
23 } | 24 } |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
105 ContextProvider* context_provider() const { return context_provider_.get(); } | 106 ContextProvider* context_provider() const { return context_provider_.get(); } |
106 ContextProvider* worker_context_provider() const { | 107 ContextProvider* worker_context_provider() const { |
107 return worker_context_provider_.get(); | 108 return worker_context_provider_.get(); |
108 } | 109 } |
109 SoftwareOutputDevice* software_device() const { | 110 SoftwareOutputDevice* software_device() const { |
110 return software_device_.get(); | 111 return software_device_.get(); |
111 } | 112 } |
112 | 113 |
113 // Called by the compositor on the compositor thread. This is a place where | 114 // Called by the compositor on the compositor thread. This is a place where |
114 // thread-specific data for the output surface can be initialized, since from | 115 // thread-specific data for the output surface can be initialized, since from |
115 // this point on the output surface will only be used on the compositor | 116 // this point to when DetachFromClient() is called the output surface will |
116 // thread. | 117 // only be used on the compositor thread. |
117 virtual bool BindToClient(OutputSurfaceClient* client); | 118 virtual bool BindToClient(OutputSurfaceClient* client); |
119 // Called by the compositor on the compositor thread. This is a place where | |
danakj
2015/09/12 00:09:14
nit: whitespace before the comment please
reveman
2015/09/12 12:49:57
Done.
| |
120 // thread-specific data for the output surface can be uninitialized. | |
121 virtual void DetachFromClient(); | |
122 | |
123 bool CalledOnValidClientThread(); | |
danakj
2015/09/12 00:09:14
Do we need a public method?
reveman
2015/09/12 12:49:57
Good point. Removed.
| |
118 | 124 |
119 virtual void EnsureBackbuffer(); | 125 virtual void EnsureBackbuffer(); |
120 virtual void DiscardBackbuffer(); | 126 virtual void DiscardBackbuffer(); |
121 | 127 |
122 virtual void Reshape(const gfx::Size& size, float scale_factor); | 128 virtual void Reshape(const gfx::Size& size, float scale_factor); |
123 gfx::Size SurfaceSize() const { return surface_size_; } | 129 gfx::Size SurfaceSize() const { return surface_size_; } |
124 float device_scale_factor() const { return device_scale_factor_; } | 130 float device_scale_factor() const { return device_scale_factor_; } |
125 | 131 |
126 // If supported, this causes a ReclaimResources for all resources that are | 132 // If supported, this causes a ReclaimResources for all resources that are |
127 // currently in use. | 133 // currently in use. |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
186 void SetExternalDrawConstraints( | 192 void SetExternalDrawConstraints( |
187 const gfx::Transform& transform, | 193 const gfx::Transform& transform, |
188 const gfx::Rect& viewport, | 194 const gfx::Rect& viewport, |
189 const gfx::Rect& clip, | 195 const gfx::Rect& clip, |
190 const gfx::Rect& viewport_rect_for_tile_priority, | 196 const gfx::Rect& viewport_rect_for_tile_priority, |
191 const gfx::Transform& transform_for_tile_priority, | 197 const gfx::Transform& transform_for_tile_priority, |
192 bool resourceless_software_draw); | 198 bool resourceless_software_draw); |
193 | 199 |
194 private: | 200 private: |
195 bool external_stencil_test_enabled_; | 201 bool external_stencil_test_enabled_; |
202 base::ThreadChecker client_thread_checker_; | |
danakj
2015/09/12 00:09:14
just make this protected?
reveman
2015/09/12 12:49:57
Done.
| |
196 | 203 |
197 base::WeakPtrFactory<OutputSurface> weak_ptr_factory_; | 204 base::WeakPtrFactory<OutputSurface> weak_ptr_factory_; |
198 | 205 |
199 DISALLOW_COPY_AND_ASSIGN(OutputSurface); | 206 DISALLOW_COPY_AND_ASSIGN(OutputSurface); |
200 }; | 207 }; |
201 | 208 |
202 } // namespace cc | 209 } // namespace cc |
203 | 210 |
204 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ | 211 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ |
OLD | NEW |