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 CCResourceUpdateController_h | 5 #ifndef CCResourceUpdateController_h |
6 #define CCResourceUpdateController_h | 6 #define CCResourceUpdateController_h |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "base/time.h" | 11 #include "base/time.h" |
| 12 #include "cc/cc_export.h" |
12 #include "cc/resource_update_queue.h" | 13 #include "cc/resource_update_queue.h" |
13 | 14 |
14 namespace cc { | 15 namespace cc { |
15 | 16 |
16 class ResourceProvider; | 17 class ResourceProvider; |
17 class Thread; | 18 class Thread; |
18 | 19 |
19 class ResourceUpdateControllerClient { | 20 class ResourceUpdateControllerClient { |
20 public: | 21 public: |
21 virtual void readyToFinalizeTextureUpdates() = 0; | 22 virtual void readyToFinalizeTextureUpdates() = 0; |
22 | 23 |
23 protected: | 24 protected: |
24 virtual ~ResourceUpdateControllerClient() { } | 25 virtual ~ResourceUpdateControllerClient() { } |
25 }; | 26 }; |
26 | 27 |
27 class ResourceUpdateController { | 28 class CC_EXPORT ResourceUpdateController { |
28 public: | 29 public: |
29 static scoped_ptr<ResourceUpdateController> create(ResourceUpdateControllerC
lient* client, Thread* thread, scoped_ptr<ResourceUpdateQueue> queue, ResourcePr
ovider* resourceProvider) | 30 static scoped_ptr<ResourceUpdateController> create(ResourceUpdateControllerC
lient* client, Thread* thread, scoped_ptr<ResourceUpdateQueue> queue, ResourcePr
ovider* resourceProvider) |
30 { | 31 { |
31 return make_scoped_ptr(new ResourceUpdateController(client, thread, queu
e.Pass(), resourceProvider)); | 32 return make_scoped_ptr(new ResourceUpdateController(client, thread, queu
e.Pass(), resourceProvider)); |
32 } | 33 } |
33 static size_t maxPartialTextureUpdates(); | 34 static size_t maxPartialTextureUpdates(); |
34 | 35 |
35 virtual ~ResourceUpdateController(); | 36 virtual ~ResourceUpdateController(); |
36 | 37 |
37 // Discard uploads to textures that were evicted on the impl thread. | 38 // Discard uploads to textures that were evicted on the impl thread. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 Thread* m_thread; | 72 Thread* m_thread; |
72 base::WeakPtrFactory<ResourceUpdateController> m_weakFactory; | 73 base::WeakPtrFactory<ResourceUpdateController> m_weakFactory; |
73 bool m_taskPosted; | 74 bool m_taskPosted; |
74 | 75 |
75 DISALLOW_COPY_AND_ASSIGN(ResourceUpdateController); | 76 DISALLOW_COPY_AND_ASSIGN(ResourceUpdateController); |
76 }; | 77 }; |
77 | 78 |
78 } // namespace cc | 79 } // namespace cc |
79 | 80 |
80 #endif // CCResourceUpdateController_h | 81 #endif // CCResourceUpdateController_h |
OLD | NEW |