Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(410)

Unified Diff: content/public/browser/android/ui_resource_provider.h

Issue 287593002: android: content::UIResourceProvider and content::UIResourceClientAndroid (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed dtrainor comments Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/public/browser/android/ui_resource_provider.h
diff --git a/content/public/browser/android/ui_resource_provider.h b/content/public/browser/android/ui_resource_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..732ba5a0801fae3a0c08e0c338017dd9e85640a6
--- /dev/null
+++ b/content/public/browser/android/ui_resource_provider.h
@@ -0,0 +1,61 @@
+// 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 CONTENT_PUBLIC_BROWSER_ANDROID_UI_RESOURCE_PROVIDER_H_
+#define CONTENT_PUBLIC_BROWSER_ANDROID_UI_RESOURCE_PROVIDER_H_
+
+#include "cc/resources/ui_resource_client.h"
+#include "content/common/content_export.h"
+#include "skia/ext/refptr.h"
+
+class SkBitmap;
+class SkPixelRef;
+
+namespace cc {
+class LayerTreeHost;
+}
+
+namespace gfx {
+class Size;
+}
+
+namespace content {
+
+class UIResourceListener;
+
+class CONTENT_EXPORT UIResourceProvider {
+ public:
+ virtual ~UIResourceProvider() {}
+
+ 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.
+
+ virtual void AddListener(UIResourceListener* listener) = 0;
+
+ virtual void RemoveListener(UIResourceListener* listener) = 0;
+
+ // Generates a UIResource and returns a UIResourceId. |is_transient|
+ // indicates whether or not to release the resource once the bitmap
+ // has been uploaded. May return 0.
+ virtual cc::UIResourceId GenerateUIResource(const SkBitmap& bitmap,
+ bool is_transient) = 0;
+
+ // Generates an ETC1 compressed UIResource. See above for |is_transient|.
+ // May return 0.
+ virtual cc::UIResourceId GenerateCompressedUIResource(
+ const skia::RefPtr<SkPixelRef>& pixel_ref,
+ bool is_transient) = 0;
+
+ // Same as above method but makes a copy of |pixels|.
+ // TODO(powei): should be removed once the thumbnail work is in place.
+ virtual cc::UIResourceId GenerateCompressedUIResource(const gfx::Size& size,
+ void* pixels,
+ bool is_transient) = 0;
+
+ // Deletes a UIResource. Deleting a non-existent resource is allowed.
+ virtual void DeleteUIResource(cc::UIResourceId resource_id) = 0;
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_BROWSER_ANDROID_UI_RESOURCE_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698