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 CC_TEST_TEST_SHARED_BITMAP_MANAGER_H_ | 5 #ifndef CC_TEST_TEST_SHARED_BITMAP_MANAGER_H_ |
6 #define CC_TEST_TEST_SHARED_BITMAP_MANAGER_H_ | 6 #define CC_TEST_TEST_SHARED_BITMAP_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
11 #include "cc/resources/shared_bitmap_manager.h" | 11 #include "cc/resources/shared_bitmap_manager.h" |
12 | 12 |
13 namespace cc { | 13 namespace cc { |
14 | 14 |
15 class TestSharedBitmapManager : public SharedBitmapManager { | 15 class TestSharedBitmapManager : public SharedBitmapManager { |
16 public: | 16 public: |
17 TestSharedBitmapManager(); | 17 TestSharedBitmapManager(); |
18 ~TestSharedBitmapManager() override; | 18 ~TestSharedBitmapManager() override; |
19 | 19 |
20 scoped_ptr<SharedBitmap> AllocateSharedBitmap(const gfx::Size& size) override; | 20 scoped_ptr<SharedBitmap> AllocateSharedBitmap(const gfx::Size& size) override; |
21 | 21 |
22 scoped_ptr<SharedBitmap> GetSharedBitmapFromId( | 22 scoped_ptr<SharedBitmap> GetSharedBitmapFromId( |
23 const gfx::Size&, | 23 const gfx::Size&, |
24 const SharedBitmapId& id) override; | 24 const SharedBitmapId& id) override; |
25 | 25 |
26 scoped_ptr<SharedBitmap> GetBitmapForSharedMemory( | |
27 base::SharedMemory* memory) override; | |
28 | |
29 private: | 26 private: |
30 base::Lock lock_; | 27 base::Lock lock_; |
31 std::map<SharedBitmapId, base::SharedMemory*> bitmap_map_; | 28 std::map<SharedBitmapId, base::SharedMemory*> bitmap_map_; |
32 }; | 29 }; |
33 | 30 |
34 } // namespace cc | 31 } // namespace cc |
35 | 32 |
36 #endif // CC_TEST_TEST_SHARED_BITMAP_MANAGER_H_ | 33 #endif // CC_TEST_TEST_SHARED_BITMAP_MANAGER_H_ |
OLD | NEW |