| 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> |
| 9 |
| 8 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 9 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 12 #include "cc/base/cc_export.h" | 14 #include "cc/base/cc_export.h" |
| 13 #include "cc/output/context_provider.h" | 15 #include "cc/output/context_provider.h" |
| 14 #include "cc/output/software_output_device.h" | 16 #include "cc/output/software_output_device.h" |
| 15 #include "cc/scheduler/frame_rate_controller.h" | 17 #include "cc/scheduler/frame_rate_controller.h" |
| 16 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | 18 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" |
| 17 | 19 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 | 177 |
| 176 // virtual for testing. | 178 // virtual for testing. |
| 177 virtual base::TimeTicks RetroactiveBeginFrameDeadline(); | 179 virtual base::TimeTicks RetroactiveBeginFrameDeadline(); |
| 178 virtual void PostCheckForRetroactiveBeginFrame(); | 180 virtual void PostCheckForRetroactiveBeginFrame(); |
| 179 void CheckForRetroactiveBeginFrame(); | 181 void CheckForRetroactiveBeginFrame(); |
| 180 | 182 |
| 181 private: | 183 private: |
| 182 OutputSurfaceClient* client_; | 184 OutputSurfaceClient* client_; |
| 183 friend class OutputSurfaceCallbacks; | 185 friend class OutputSurfaceCallbacks; |
| 184 | 186 |
| 187 void AddSkippedBeginFrame(const BeginFrameArgs& skipped); |
| 185 void SetContext3D(scoped_ptr<WebKit::WebGraphicsContext3D> context3d); | 188 void SetContext3D(scoped_ptr<WebKit::WebGraphicsContext3D> context3d); |
| 186 void ResetContext3D(); | 189 void ResetContext3D(); |
| 187 void SetMemoryPolicy(const ManagedMemoryPolicy& policy, | 190 void SetMemoryPolicy(const ManagedMemoryPolicy& policy, |
| 188 bool discard_backbuffer_when_not_visible); | 191 bool discard_backbuffer_when_not_visible); |
| 189 | 192 |
| 190 // This stores a BeginFrame that we couldn't process immediately, but might | 193 // This stores a BeginFrame that we couldn't process immediately, but might |
| 191 // process retroactively in the near future. | 194 // process retroactively in the near future. |
| 192 BeginFrameArgs skipped_begin_frame_args_; | 195 std::deque<BeginFrameArgs> skipped_begin_frame_args_; |
| 196 int consecutive_missed_deadlines_; |
| 193 | 197 |
| 194 // check_for_retroactive_begin_frame_pending_ is used to avoid posting | 198 // check_for_retroactive_begin_frame_pending_ is used to avoid posting |
| 195 // redundant checks for a retroactive BeginFrame. | 199 // redundant checks for a retroactive BeginFrame. |
| 196 bool check_for_retroactive_begin_frame_pending_; | 200 bool check_for_retroactive_begin_frame_pending_; |
| 197 | 201 |
| 198 DISALLOW_COPY_AND_ASSIGN(OutputSurface); | 202 DISALLOW_COPY_AND_ASSIGN(OutputSurface); |
| 199 }; | 203 }; |
| 200 | 204 |
| 201 } // namespace cc | 205 } // namespace cc |
| 202 | 206 |
| 203 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ | 207 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ |
| OLD | NEW |