Chromium Code Reviews| 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 UI_ANDROID_RESOURCES_UI_RESOURCE_PROVIDER_H_ | 5 #ifndef UI_ANDROID_RESOURCES_UI_RESOURCE_PROVIDER_H_ |
| 6 #define UI_ANDROID_RESOURCES_UI_RESOURCE_PROVIDER_H_ | 6 #define UI_ANDROID_RESOURCES_UI_RESOURCE_PROVIDER_H_ |
| 7 | 7 |
| 8 #include "base/containers/hash_tables.h" | 8 #include "base/containers/hash_tables.h" |
|
jdduke (slow)
2015/09/30 17:19:44
Nit: Looks like we don't need the hash include.
no sievers
2015/09/30 21:58:48
Done.
| |
| 9 #include "cc/resources/ui_resource_client.h" | 9 #include "cc/resources/ui_resource_client.h" |
| 10 #include "ui/android/ui_android_export.h" | 10 #include "ui/android/ui_android_export.h" |
| 11 | 11 |
| 12 namespace cc { | 12 namespace cc { |
| 13 class LayerTreeHost; | 13 class LayerTreeHost; |
|
jdduke (slow)
2015/09/30 17:19:44
Nit: Looks like we can lose this decl.
no sievers
2015/09/30 21:58:48
Done.
| |
| 14 } | 14 } |
| 15 | 15 |
| 16 namespace ui { | 16 namespace ui { |
| 17 | 17 |
| 18 class UIResourceClientAndroid; | |
| 19 | |
| 20 class UI_ANDROID_EXPORT UIResourceProvider { | 18 class UI_ANDROID_EXPORT UIResourceProvider { |
| 21 public: | 19 public: |
| 22 UIResourceProvider(); | 20 virtual cc::UIResourceId CreateUIResource(cc::UIResourceClient* client) = 0; |
| 23 ~UIResourceProvider(); | 21 virtual void DeleteUIResource(cc::UIResourceId resource_id) = 0; |
| 22 virtual bool SupportsETC1NonPowerOfTwo() const = 0; | |
| 24 | 23 |
| 25 void SetLayerTreeHost(cc::LayerTreeHost* host); | 24 protected: |
| 26 | 25 UIResourceProvider() {} |
|
jdduke (slow)
2015/09/30 17:19:44
Do we need the constructor?
no sievers
2015/09/30 21:58:48
Done.
| |
| 27 void UIResourcesAreInvalid(); | 26 virtual ~UIResourceProvider() {} |
| 28 | |
| 29 virtual cc::UIResourceId CreateUIResource( | |
| 30 ui::UIResourceClientAndroid* client); | |
| 31 | |
| 32 virtual void DeleteUIResource(cc::UIResourceId resource_id); | |
| 33 | |
| 34 void SetSupportsETC1NonPowerOfTwo(bool supports_etc1_npot) { | |
| 35 supports_etc1_npot_ = supports_etc1_npot; | |
| 36 } | |
| 37 | |
| 38 virtual bool SupportsETC1NonPowerOfTwo() const; | |
| 39 | |
| 40 private: | |
| 41 typedef base::hash_map<cc::UIResourceId, ui::UIResourceClientAndroid*> | |
| 42 UIResourceClientMap; | |
| 43 UIResourceClientMap ui_resource_client_map_; | |
| 44 cc::LayerTreeHost* host_; | |
| 45 bool supports_etc1_npot_; | |
| 46 | |
| 47 DISALLOW_COPY_AND_ASSIGN(UIResourceProvider); | |
| 48 }; | 27 }; |
| 49 | 28 |
| 50 } // namespace ui | 29 } // namespace ui |
| 51 | 30 |
| 52 #endif // UI_ANDROID_RESOURCES_UI_RESOURCE_PROVIDER_H_ | 31 #endif // UI_ANDROID_RESOURCES_UI_RESOURCE_PROVIDER_H_ |
| OLD | NEW |