OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CC_TILE_MANAGER_H_ |
| 6 #define CC_TILE_MANAGER_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 namespace cc { |
| 11 |
| 12 class Tile; |
| 13 class ResourceProvider; |
| 14 |
| 15 class TileManagerClient { |
| 16 public: |
| 17 virtual void ScheduleManage() = 0; |
| 18 |
| 19 protected: |
| 20 ~TileManagerClient() { } |
| 21 }; |
| 22 |
| 23 // This class manages tiles, deciding which should get rasterized and which |
| 24 // should no longer have any memory assigned to them. Tile objects are "owned" |
| 25 // by layers; they automatically register with the manager when they are |
| 26 // created, and unregister from the manager when they are deleted. |
| 27 class TileManager { |
| 28 public: |
| 29 TileManager(TileManagerClient* client); |
| 30 ~TileManager(); |
| 31 void Manage() { } |
| 32 |
| 33 protected: |
| 34 // Methods called by Tile |
| 35 void RegisterTile(Tile*); |
| 36 void UnregisterTile(Tile*); |
| 37 |
| 38 private: |
| 39 friend class Tile; |
| 40 |
| 41 TileManagerClient* client_; |
| 42 std::vector<Tile*> registered_tiles_; |
| 43 }; |
| 44 |
| 45 } |
| 46 |
| 47 #endif |
OLD | NEW |