| OLD | NEW |
| 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 CC_SURFACES_ONSCREEN_DISPLAY_CLIENT_H_ | 5 #ifndef CC_SURFACES_ONSCREEN_DISPLAY_CLIENT_H_ |
| 6 #define CC_SURFACES_ONSCREEN_DISPLAY_CLIENT_H_ | 6 #define CC_SURFACES_ONSCREEN_DISPLAY_CLIENT_H_ |
| 7 | 7 |
| 8 #include "cc/surfaces/display_client.h" | 8 #include "cc/surfaces/display_client.h" |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 surface_display_output_surface_ = surface; | 39 surface_display_output_surface_ = surface; |
| 40 } | 40 } |
| 41 | 41 |
| 42 // DisplayClient implementation. | 42 // DisplayClient implementation. |
| 43 void DisplayDamaged() override; | 43 void DisplayDamaged() override; |
| 44 void DidSwapBuffers() override; | 44 void DidSwapBuffers() override; |
| 45 void DidSwapBuffersComplete() override; | 45 void DidSwapBuffersComplete() override; |
| 46 void CommitVSyncParameters(base::TimeTicks timebase, | 46 void CommitVSyncParameters(base::TimeTicks timebase, |
| 47 base::TimeDelta interval) override; | 47 base::TimeDelta interval) override; |
| 48 void OutputSurfaceLost() override; | 48 void OutputSurfaceLost() override; |
| 49 void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; | |
| 50 | 49 |
| 51 bool output_surface_lost() { return output_surface_lost_; } | 50 bool output_surface_lost() { return output_surface_lost_; } |
| 52 | 51 |
| 53 private: | 52 private: |
| 54 void ScheduleDraw(); | 53 void ScheduleDraw(); |
| 55 void Draw(); | 54 void Draw(); |
| 56 | 55 |
| 57 scoped_ptr<OutputSurface> output_surface_; | 56 scoped_ptr<OutputSurface> output_surface_; |
| 58 scoped_ptr<Display> display_; | 57 scoped_ptr<Display> display_; |
| 59 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 58 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 60 SurfaceDisplayOutputSurface* surface_display_output_surface_; | 59 SurfaceDisplayOutputSurface* surface_display_output_surface_; |
| 61 bool scheduled_draw_; | 60 bool scheduled_draw_; |
| 62 bool output_surface_lost_; | 61 bool output_surface_lost_; |
| 63 // True if a draw should be scheduled, but it's hit the limit on max frames | 62 // True if a draw should be scheduled, but it's hit the limit on max frames |
| 64 // pending. | 63 // pending. |
| 65 bool deferred_draw_; | 64 bool deferred_draw_; |
| 66 int pending_frames_; | 65 int pending_frames_; |
| 67 | 66 |
| 68 base::WeakPtrFactory<OnscreenDisplayClient> weak_ptr_factory_; | 67 base::WeakPtrFactory<OnscreenDisplayClient> weak_ptr_factory_; |
| 69 | 68 |
| 70 DISALLOW_COPY_AND_ASSIGN(OnscreenDisplayClient); | 69 DISALLOW_COPY_AND_ASSIGN(OnscreenDisplayClient); |
| 71 }; | 70 }; |
| 72 | 71 |
| 73 } // namespace cc | 72 } // namespace cc |
| 74 | 73 |
| 75 #endif // CC_SURFACES_ONSCREEN_DISPLAY_CLIENT_H_ | 74 #endif // CC_SURFACES_ONSCREEN_DISPLAY_CLIENT_H_ |
| OLD | NEW |