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

Side by Side Diff: cc/output/output_surface.h

Issue 23503003: cc: Add readback and forced draw states to the Scheduler (Closed) Base URL: http://git.chromium.org/chromium/src.git@schedReorg3
Patch Set: Fix mac_rel failure by returning false from CanReadback when context lost Created 7 years, 3 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 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 "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 // Notifies frame-rate smoothness preference. If true, all non-critical 118 // Notifies frame-rate smoothness preference. If true, all non-critical
119 // processing should be stopped, or lowered in priority. 119 // processing should be stopped, or lowered in priority.
120 virtual void UpdateSmoothnessTakesPriority(bool prefer_smoothness) {} 120 virtual void UpdateSmoothnessTakesPriority(bool prefer_smoothness) {}
121 121
122 // Requests a BeginFrame notification from the output surface. The 122 // Requests a BeginFrame notification from the output surface. The
123 // notification will be delivered by calling 123 // notification will be delivered by calling
124 // OutputSurfaceClient::BeginFrame until the callback is disabled. 124 // OutputSurfaceClient::BeginFrame until the callback is disabled.
125 virtual void SetNeedsBeginFrame(bool enable); 125 virtual void SetNeedsBeginFrame(bool enable);
126 126
127 bool HasClient() { return !!client_; } 127 bool HasClient() { return !!client_; }
128 bool IsLost() { return context_is_lost_; }
128 129
129 protected: 130 protected:
130 // Synchronously initialize context3d and enter hardware mode. 131 // Synchronously initialize context3d and enter hardware mode.
131 // This can only supported in threaded compositing mode. 132 // This can only supported in threaded compositing mode.
132 // |offscreen_context_provider| should match what is returned by 133 // |offscreen_context_provider| should match what is returned by
133 // LayerTreeClient::OffscreenContextProviderForCompositorThread. 134 // LayerTreeClient::OffscreenContextProviderForCompositorThread.
134 bool InitializeAndSetContext3d( 135 bool InitializeAndSetContext3d(
135 scoped_refptr<ContextProvider> context_provider, 136 scoped_refptr<ContextProvider> context_provider,
136 scoped_refptr<ContextProvider> offscreen_context_provider); 137 scoped_refptr<ContextProvider> offscreen_context_provider);
137 void ReleaseGL(); 138 void ReleaseGL();
138 139
139 void PostSwapBuffersComplete(); 140 void PostSwapBuffersComplete();
140 141
141 struct cc::OutputSurface::Capabilities capabilities_; 142 struct cc::OutputSurface::Capabilities capabilities_;
142 scoped_refptr<ContextProvider> context_provider_; 143 scoped_refptr<ContextProvider> context_provider_;
143 scoped_ptr<cc::SoftwareOutputDevice> software_device_; 144 scoped_ptr<cc::SoftwareOutputDevice> software_device_;
145 bool context_is_lost_;
144 bool has_gl_discard_backbuffer_; 146 bool has_gl_discard_backbuffer_;
145 bool has_swap_buffers_complete_callback_; 147 bool has_swap_buffers_complete_callback_;
146 gfx::Size surface_size_; 148 gfx::Size surface_size_;
147 float device_scale_factor_; 149 float device_scale_factor_;
148 base::WeakPtrFactory<OutputSurface> weak_ptr_factory_; 150 base::WeakPtrFactory<OutputSurface> weak_ptr_factory_;
149 151
150 // The FrameRateController is deprecated. 152 // The FrameRateController is deprecated.
151 // Platforms should move to native BeginFrames instead. 153 // Platforms should move to native BeginFrames instead.
152 void OnVSyncParametersChanged(base::TimeTicks timebase, 154 void OnVSyncParametersChanged(base::TimeTicks timebase,
153 base::TimeDelta interval); 155 base::TimeDelta interval);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 // check_for_retroactive_begin_frame_pending_ is used to avoid posting 195 // check_for_retroactive_begin_frame_pending_ is used to avoid posting
194 // redundant checks for a retroactive BeginFrame. 196 // redundant checks for a retroactive BeginFrame.
195 bool check_for_retroactive_begin_frame_pending_; 197 bool check_for_retroactive_begin_frame_pending_;
196 198
197 DISALLOW_COPY_AND_ASSIGN(OutputSurface); 199 DISALLOW_COPY_AND_ASSIGN(OutputSurface);
198 }; 200 };
199 201
200 } // namespace cc 202 } // namespace cc
201 203
202 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ 204 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698