Blink roll 25b6bd3a7a131ffe68d809546ad1a20707915cdc:3a503f41ae42e5b79cfcd2ff10e65afde...
[chromium-blink-merge.git] / content / browser / android / ui_resource_provider_impl.h
blob1c29a3ed11731d0de2f6af36f996ee04eaaaeb38
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_ANDROID_UI_RESOURCE_PROVIDER_IMPL_H_
6 #define CONTENT_BROWSER_ANDROID_UI_RESOURCE_PROVIDER_IMPL_H_
8 #include "base/containers/hash_tables.h"
9 #include "content/browser/android/system_ui_resource_manager_impl.h"
10 #include "content/public/browser/android/ui_resource_provider.h"
12 namespace cc {
13 class LayerTreeHost;
16 namespace content {
18 class UIResourceClientAndroid;
20 class UIResourceProviderImpl : public UIResourceProvider {
21 public:
22 UIResourceProviderImpl();
24 virtual ~UIResourceProviderImpl();
26 void SetLayerTreeHost(cc::LayerTreeHost* host);
28 void UIResourcesAreInvalid();
30 virtual cc::UIResourceId CreateUIResource(
31 UIResourceClientAndroid* client) override;
33 virtual void DeleteUIResource(cc::UIResourceId resource_id) override;
35 ui::SystemUIResourceManager& GetSystemUIResourceManager();
37 void SetSupportsETC1NonPowerOfTwo(bool supports_etc1_npot) {
38 supports_etc1_npot_ = supports_etc1_npot;
40 virtual bool SupportsETC1NonPowerOfTwo() const override;
42 private:
43 typedef base::hash_map<cc::UIResourceId, UIResourceClientAndroid*>
44 UIResourceClientMap;
45 UIResourceClientMap ui_resource_client_map_;
46 SystemUIResourceManagerImpl system_ui_resource_manager_;
47 cc::LayerTreeHost* host_;
48 bool supports_etc1_npot_;
50 DISALLOW_COPY_AND_ASSIGN(UIResourceProviderImpl);
53 } // namespace content
55 #endif // CONTENT_BROWSER_ANDROID_UI_RESOURCE_PROVIDER_IMPL_H_