fake_ui_resource_layer_tree_host_impl.h revision 4e180b6a0b4720a9b8e9e959a882386f690f08ff
1// Copyright 2013 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_TEST_FAKE_UI_RESOURCE_LAYER_TREE_HOST_IMPL_H_
6#define CC_TEST_FAKE_UI_RESOURCE_LAYER_TREE_HOST_IMPL_H_
7
8#include "base/containers/hash_tables.h"
9#include "cc/test/fake_layer_tree_host_impl.h"
10
11namespace cc {
12
13class FakeUIResourceLayerTreeHostImpl : public FakeLayerTreeHostImpl {
14 public:
15  explicit FakeUIResourceLayerTreeHostImpl(Proxy* proxy);
16  virtual ~FakeUIResourceLayerTreeHostImpl();
17
18  virtual void CreateUIResource(UIResourceId uid,
19                                const UIResourceBitmap& bitmap) OVERRIDE;
20
21  virtual void DeleteUIResource(UIResourceId uid) OVERRIDE;
22
23  virtual ResourceProvider::ResourceId ResourceIdForUIResource(
24      UIResourceId uid) const OVERRIDE;
25
26 private:
27  ResourceProvider::ResourceId fake_next_resource_id_;
28  typedef base::hash_map<UIResourceId, ResourceProvider::ResourceId>
29      UIResourceMap;
30  UIResourceMap fake_ui_resource_map_;
31};
32
33}  // namespace cc
34
35#endif  // CC_TEST_FAKE_UI_RESOURCE_LAYER_TREE_HOST_IMPL_H_
36