OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "cc/CCFrameRateController.h" | 28 #include "cc/CCFrameRateController.h" |
29 #include "cc/CCSchedulerStateMachine.h" | 29 #include "cc/CCSchedulerStateMachine.h" |
30 | 30 |
31 #include <wtf/Noncopyable.h> | 31 #include <wtf/Noncopyable.h> |
32 #include <wtf/PassOwnPtr.h> | 32 #include <wtf/PassOwnPtr.h> |
33 | 33 |
34 namespace WebCore { | 34 namespace WebCore { |
35 | 35 |
36 class CCThread; | 36 class CCThread; |
37 | 37 |
| 38 struct CCScheduledActionDrawAndSwapResult { |
| 39 CCScheduledActionDrawAndSwapResult() |
| 40 : didDraw(false) |
| 41 , didSwap(false) |
| 42 { |
| 43 } |
| 44 CCScheduledActionDrawAndSwapResult(bool didDraw, bool didSwap) |
| 45 : didDraw(didDraw) |
| 46 , didSwap(didSwap) |
| 47 { |
| 48 } |
| 49 bool didDraw; |
| 50 bool didSwap; |
| 51 }; |
| 52 |
38 class CCSchedulerClient { | 53 class CCSchedulerClient { |
39 public: | 54 public: |
40 virtual bool canDraw() = 0; | 55 virtual bool canDraw() = 0; |
41 virtual bool hasMoreResourceUpdates() const = 0; | 56 virtual bool hasMoreResourceUpdates() const = 0; |
42 | 57 |
43 virtual void scheduledActionBeginFrame() = 0; | 58 virtual void scheduledActionBeginFrame() = 0; |
44 virtual bool scheduledActionDrawAndSwapIfPossible() = 0; | 59 virtual CCScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapIfPossi
ble() = 0; |
45 virtual void scheduledActionDrawAndSwapForced() = 0; | 60 virtual CCScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapForced(
) = 0; |
46 virtual void scheduledActionUpdateMoreResources() = 0; | 61 virtual void scheduledActionUpdateMoreResources() = 0; |
47 virtual void scheduledActionCommit() = 0; | 62 virtual void scheduledActionCommit() = 0; |
48 virtual void scheduledActionBeginContextRecreation() = 0; | 63 virtual void scheduledActionBeginContextRecreation() = 0; |
49 | 64 |
50 protected: | 65 protected: |
51 virtual ~CCSchedulerClient() { } | 66 virtual ~CCSchedulerClient() { } |
52 }; | 67 }; |
53 | 68 |
54 class CCScheduler : CCFrameRateControllerClient { | 69 class CCScheduler : CCFrameRateControllerClient { |
55 WTF_MAKE_NONCOPYABLE(CCScheduler); | 70 WTF_MAKE_NONCOPYABLE(CCScheduler); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 110 |
96 CCSchedulerClient* m_client; | 111 CCSchedulerClient* m_client; |
97 OwnPtr<CCFrameRateController> m_frameRateController; | 112 OwnPtr<CCFrameRateController> m_frameRateController; |
98 CCSchedulerStateMachine m_stateMachine; | 113 CCSchedulerStateMachine m_stateMachine; |
99 bool m_updateMoreResourcesPending; | 114 bool m_updateMoreResourcesPending; |
100 }; | 115 }; |
101 | 116 |
102 } | 117 } |
103 | 118 |
104 #endif // CCScheduler_h | 119 #endif // CCScheduler_h |
OLD | NEW |