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

Side by Side Diff: content/browser/compositor/onscreen_display_client.h

Issue 792383004: Run draw callback immediately if no Display is damaged. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 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 28 matching lines...) Expand all
39 39
40 // cc::DisplayClient implementation. 40 // cc::DisplayClient implementation.
41 void DisplayDamaged() override; 41 void DisplayDamaged() override;
42 void DidSwapBuffers() override; 42 void DidSwapBuffers() override;
43 void DidSwapBuffersComplete() override; 43 void DidSwapBuffersComplete() override;
44 void CommitVSyncParameters(base::TimeTicks timebase, 44 void CommitVSyncParameters(base::TimeTicks timebase,
45 base::TimeDelta interval) override; 45 base::TimeDelta interval) override;
46 void OutputSurfaceLost() override; 46 void OutputSurfaceLost() override;
47 void SetMemoryPolicy(const cc::ManagedMemoryPolicy& policy) override; 47 void SetMemoryPolicy(const cc::ManagedMemoryPolicy& policy) override;
48 48
49 bool output_surface_lost() { return output_surface_lost_; }
50
49 private: 51 private:
50 void ScheduleDraw(); 52 void ScheduleDraw();
51 void Draw(); 53 void Draw();
52 54
53 scoped_ptr<cc::OutputSurface> output_surface_; 55 scoped_ptr<cc::OutputSurface> output_surface_;
54 scoped_ptr<cc::Display> display_; 56 scoped_ptr<cc::Display> display_;
55 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 57 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
56 SurfaceDisplayOutputSurface* surface_display_output_surface_; 58 SurfaceDisplayOutputSurface* surface_display_output_surface_;
57 bool scheduled_draw_; 59 bool scheduled_draw_;
58 bool output_surface_lost_; 60 bool output_surface_lost_;
59 // True if a draw should be scheduled, but it's hit the limit on max frames 61 // True if a draw should be scheduled, but it's hit the limit on max frames
60 // pending. 62 // pending.
61 bool deferred_draw_; 63 bool deferred_draw_;
62 int pending_frames_; 64 int pending_frames_;
63 65
64 base::WeakPtrFactory<OnscreenDisplayClient> weak_ptr_factory_; 66 base::WeakPtrFactory<OnscreenDisplayClient> weak_ptr_factory_;
65 67
66 DISALLOW_COPY_AND_ASSIGN(OnscreenDisplayClient); 68 DISALLOW_COPY_AND_ASSIGN(OnscreenDisplayClient);
67 }; 69 };
68 70
69 } // namespace content 71 } // namespace content
70 72
71 #endif // CONTENT_BROWSER_COMPOSITOR_ONSCREEN_DISPLAY_CLIENT_H_ 73 #endif // CONTENT_BROWSER_COMPOSITOR_ONSCREEN_DISPLAY_CLIENT_H_
OLDNEW
« no previous file with comments | « content/browser/compositor/delegated_frame_host.cc ('k') | content/browser/compositor/surface_display_output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698