Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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. | |
| 4 | |
| 5 #ifndef CONTENT_PUBLIC_BROWSER_ANDROID_UI_RESOURCE_PROVIDER_H_ | |
| 6 #define CONTENT_PUBLIC_BROWSER_ANDROID_UI_RESOURCE_PROVIDER_H_ | |
| 7 | |
| 8 #include "cc/resources/ui_resource_client.h" | |
| 9 #include "content/common/content_export.h" | |
| 10 #include "skia/ext/refptr.h" | |
| 11 | |
| 12 class SkBitmap; | |
| 13 class SkPixelRef; | |
| 14 | |
| 15 namespace cc { | |
| 16 class LayerTreeHost; | |
| 17 } | |
| 18 | |
| 19 namespace gfx { | |
| 20 class Size; | |
| 21 } | |
| 22 | |
| 23 namespace content { | |
| 24 | |
| 25 class UIResourceListener; | |
| 26 | |
| 27 class CONTENT_EXPORT UIResourceProvider { | |
| 28 public: | |
| 29 virtual ~UIResourceProvider() {} | |
| 30 | |
| 31 virtual void SetLayerTreeHost(cc::LayerTreeHost* host) = 0; | |
|
no sievers
2014/05/16 20:12:19
I think we don't need to expost SetLayerTreeHost()
powei
2014/05/19 18:49:46
Done. good catch.
| |
| 32 | |
| 33 virtual void AddListener(UIResourceListener* listener) = 0; | |
| 34 | |
| 35 virtual void RemoveListener(UIResourceListener* listener) = 0; | |
| 36 | |
| 37 // Generates a UIResource and returns a UIResourceId. |is_transient| | |
| 38 // indicates whether or not to release the resource once the bitmap | |
| 39 // has been uploaded. May return 0. | |
| 40 virtual cc::UIResourceId GenerateUIResource(const SkBitmap& bitmap, | |
| 41 bool is_transient) = 0; | |
| 42 | |
| 43 // Generates an ETC1 compressed UIResource. See above for |is_transient|. | |
| 44 // May return 0. | |
| 45 virtual cc::UIResourceId GenerateCompressedUIResource( | |
| 46 const skia::RefPtr<SkPixelRef>& pixel_ref, | |
| 47 bool is_transient) = 0; | |
| 48 | |
| 49 // Same as above method but makes a copy of |pixels|. | |
| 50 // TODO(powei): should be removed once the thumbnail work is in place. | |
| 51 virtual cc::UIResourceId GenerateCompressedUIResource(const gfx::Size& size, | |
| 52 void* pixels, | |
| 53 bool is_transient) = 0; | |
| 54 | |
| 55 // Deletes a UIResource. Deleting a non-existent resource is allowed. | |
| 56 virtual void DeleteUIResource(cc::UIResourceId resource_id) = 0; | |
| 57 }; | |
| 58 | |
| 59 } // namespace content | |
| 60 | |
| 61 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_UI_RESOURCE_PROVIDER_H_ | |
| OLD | NEW |