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" |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 // Represents the output surface for a compositor. The compositor owns | 39 // Represents the output surface for a compositor. The compositor owns |
40 // and manages its destruction. Its lifetime is: | 40 // and manages its destruction. Its lifetime is: |
41 // 1. Created on the main thread by the LayerTreeHost through its client. | 41 // 1. Created on the main thread by the LayerTreeHost through its client. |
42 // 2. Passed to the compositor thread and bound to a client via BindToClient. | 42 // 2. Passed to the compositor thread and bound to a client via BindToClient. |
43 // From here on, it will only be used on the compositor thread. | 43 // From here on, it will only be used on the compositor thread. |
44 // 3. If the 3D context is lost, then the compositor will delete the output | 44 // 3. If the 3D context is lost, then the compositor will delete the output |
45 // surface (on the compositor thread) and go back to step 1. | 45 // surface (on the compositor thread) and go back to step 1. |
46 class CC_EXPORT OutputSurface : public base::trace_event::MemoryDumpProvider { | 46 class CC_EXPORT OutputSurface : public base::trace_event::MemoryDumpProvider { |
47 public: | 47 public: |
48 enum { | |
49 DEFAULT_MAX_FRAMES_PENDING = 2 | |
50 }; | |
51 | |
52 OutputSurface(const scoped_refptr<ContextProvider>& context_provider, | 48 OutputSurface(const scoped_refptr<ContextProvider>& context_provider, |
53 const scoped_refptr<ContextProvider>& worker_context_provider, | 49 const scoped_refptr<ContextProvider>& worker_context_provider, |
54 scoped_ptr<SoftwareOutputDevice> software_device); | 50 scoped_ptr<SoftwareOutputDevice> software_device); |
55 OutputSurface(const scoped_refptr<ContextProvider>& context_provider, | 51 OutputSurface(const scoped_refptr<ContextProvider>& context_provider, |
56 const scoped_refptr<ContextProvider>& worker_context_provider); | 52 const scoped_refptr<ContextProvider>& worker_context_provider); |
57 explicit OutputSurface( | 53 explicit OutputSurface( |
58 const scoped_refptr<ContextProvider>& context_provider); | 54 const scoped_refptr<ContextProvider>& context_provider); |
59 | 55 |
60 explicit OutputSurface(scoped_ptr<SoftwareOutputDevice> software_device); | 56 explicit OutputSurface(scoped_ptr<SoftwareOutputDevice> software_device); |
61 | 57 |
62 OutputSurface(const scoped_refptr<ContextProvider>& context_provider, | 58 OutputSurface(const scoped_refptr<ContextProvider>& context_provider, |
63 scoped_ptr<SoftwareOutputDevice> software_device); | 59 scoped_ptr<SoftwareOutputDevice> software_device); |
64 | 60 |
65 ~OutputSurface() override; | 61 ~OutputSurface() override; |
66 | 62 |
67 struct Capabilities { | 63 struct Capabilities { |
68 Capabilities() | 64 Capabilities() |
69 : delegated_rendering(false), | 65 : delegated_rendering(false), |
70 max_frames_pending(0), | 66 max_frames_pending(1), |
71 adjust_deadline_for_parent(true), | 67 adjust_deadline_for_parent(true), |
72 uses_default_gl_framebuffer(true), | 68 uses_default_gl_framebuffer(true), |
73 flipped_output_surface(false), | 69 flipped_output_surface(false), |
74 can_force_reclaim_resources(false), | 70 can_force_reclaim_resources(false), |
75 delegated_sync_points_required(true) {} | 71 delegated_sync_points_required(true) {} |
76 bool delegated_rendering; | 72 bool delegated_rendering; |
77 int max_frames_pending; | 73 int max_frames_pending; |
78 // This doesn't handle the <webview> case, but once BeginFrame is | 74 // This doesn't handle the <webview> case, but once BeginFrame is |
79 // supported natively, we shouldn't need adjust_deadline_for_parent. | 75 // supported natively, we shouldn't need adjust_deadline_for_parent. |
80 bool adjust_deadline_for_parent; | 76 bool adjust_deadline_for_parent; |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 bool external_stencil_test_enabled_; | 203 bool external_stencil_test_enabled_; |
208 | 204 |
209 base::WeakPtrFactory<OutputSurface> weak_ptr_factory_; | 205 base::WeakPtrFactory<OutputSurface> weak_ptr_factory_; |
210 | 206 |
211 DISALLOW_COPY_AND_ASSIGN(OutputSurface); | 207 DISALLOW_COPY_AND_ASSIGN(OutputSurface); |
212 }; | 208 }; |
213 | 209 |
214 } // namespace cc | 210 } // namespace cc |
215 | 211 |
216 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ | 212 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ |
OLD | NEW |