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 CONTENT_BROWSER_COMPOSITOR_ONSCREEN_DISPLAY_CLIENT_H_ | 5 #ifndef CONTENT_BROWSER_COMPOSITOR_ONSCREEN_DISPLAY_CLIENT_H_ |
6 #define CONTENT_BROWSER_COMPOSITOR_ONSCREEN_DISPLAY_CLIENT_H_ | 6 #define CONTENT_BROWSER_COMPOSITOR_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/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 scoped_ptr<cc::OutputSurface> output_surface, | 27 scoped_ptr<cc::OutputSurface> output_surface, |
28 cc::SurfaceManager* manager, | 28 cc::SurfaceManager* manager, |
29 scoped_refptr<base::SingleThreadTaskRunner> task_runner); | 29 scoped_refptr<base::SingleThreadTaskRunner> task_runner); |
30 virtual ~OnscreenDisplayClient(); | 30 virtual ~OnscreenDisplayClient(); |
31 | 31 |
32 cc::Display* display() { return display_.get(); } | 32 cc::Display* display() { return display_.get(); } |
33 | 33 |
34 // cc::DisplayClient implementation. | 34 // cc::DisplayClient implementation. |
35 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface() OVERRIDE; | 35 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface() OVERRIDE; |
36 virtual void DisplayDamaged() OVERRIDE; | 36 virtual void DisplayDamaged() OVERRIDE; |
| 37 virtual void DidSwapBuffers() OVERRIDE; |
| 38 virtual void DidSwapBuffersComplete() OVERRIDE; |
37 | 39 |
38 private: | 40 private: |
| 41 void ScheduleDraw(); |
39 void Draw(); | 42 void Draw(); |
40 | 43 |
41 scoped_ptr<cc::OutputSurface> output_surface_; | 44 scoped_ptr<cc::OutputSurface> output_surface_; |
42 scoped_ptr<cc::Display> display_; | 45 scoped_ptr<cc::Display> display_; |
43 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 46 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
44 bool scheduled_draw_; | 47 bool scheduled_draw_; |
| 48 // True if a draw should be scheduled, but it's hit the limit on max frames |
| 49 // pending. |
| 50 bool deferred_draw_; |
| 51 int pending_frames_; |
45 | 52 |
46 base::WeakPtrFactory<OnscreenDisplayClient> weak_ptr_factory_; | 53 base::WeakPtrFactory<OnscreenDisplayClient> weak_ptr_factory_; |
47 | 54 |
48 DISALLOW_COPY_AND_ASSIGN(OnscreenDisplayClient); | 55 DISALLOW_COPY_AND_ASSIGN(OnscreenDisplayClient); |
49 }; | 56 }; |
50 | 57 |
51 } // namespace content | 58 } // namespace content |
52 | 59 |
53 #endif // CONTENT_BROWSER_COMPOSITOR_ONSCREEN_DISPLAY_CLIENT_H_ | 60 #endif // CONTENT_BROWSER_COMPOSITOR_ONSCREEN_DISPLAY_CLIENT_H_ |
OLD | NEW |