summaryrefslogtreecommitdiffstats
path: root/cc/test/test_shared_bitmap_manager.h
diff options
context:
space:
mode:
authorjbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-20 17:25:45 +0000
committerjbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-20 17:25:45 +0000
commit4e2eb35838d42017542959dbef29d84ca6d2bbc4 (patch)
tree7eabd0b457f008c43398e158cabdd616d9cf7a61 /cc/test/test_shared_bitmap_manager.h
parent22e548845b1548ebad28c9d68ad075bce949ec57 (diff)
downloadchromium_src-4e2eb35838d42017542959dbef29d84ca6d2bbc4.zip
chromium_src-4e2eb35838d42017542959dbef29d84ca6d2bbc4.tar.gz
chromium_src-4e2eb35838d42017542959dbef29d84ca6d2bbc4.tar.bz2
Switch to use SharedBitmapManager all the time in cc_unittests
This matches the behavior of the browser and renderer better, and lets us use SharedBitmaps in more tests. Review URL: https://codereview.chromium.org/202763002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@258318 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/test_shared_bitmap_manager.h')
-rw-r--r--cc/test/test_shared_bitmap_manager.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/cc/test/test_shared_bitmap_manager.h b/cc/test/test_shared_bitmap_manager.h
new file mode 100644
index 0000000..29529409
--- /dev/null
+++ b/cc/test/test_shared_bitmap_manager.h
@@ -0,0 +1,37 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_TEST_TEST_SHARED_BITMAP_MANAGER_H_
+#define CC_TEST_TEST_SHARED_BITMAP_MANAGER_H_
+
+#include <map>
+
+#include "base/synchronization/lock.h"
+#include "cc/resources/shared_bitmap_manager.h"
+
+namespace cc {
+
+class TestSharedBitmapManager : public SharedBitmapManager {
+ public:
+ TestSharedBitmapManager();
+ virtual ~TestSharedBitmapManager();
+
+ virtual scoped_ptr<SharedBitmap> AllocateSharedBitmap(const gfx::Size& size)
+ OVERRIDE;
+
+ virtual scoped_ptr<SharedBitmap> GetSharedBitmapFromId(
+ const gfx::Size&,
+ const SharedBitmapId& id) OVERRIDE;
+
+ virtual scoped_ptr<SharedBitmap> GetBitmapForSharedMemory(
+ base::SharedMemory* memory) OVERRIDE;
+
+ private:
+ base::Lock lock_;
+ std::map<SharedBitmapId, base::SharedMemory*> bitmap_map_;
+};
+
+} // namespace cc
+
+#endif // CC_TEST_TEST_SHARED_BITMAP_MANAGER_H_