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

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

Issue 176943004: [Android] Implement asynchronous zero-copy bitmap capture API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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/content_view_core.h
diff --git a/content/public/browser/android/content_view_core.h b/content/public/browser/android/content_view_core.h
index 8437e7bbd43c2240ae299aaf077937f55dab57ab..0f79e68ebd75aca43369c6e8bb1791c792ebde3a 100644
--- a/content/public/browser/android/content_view_core.h
+++ b/content/public/browser/android/content_view_core.h
@@ -11,8 +11,8 @@
#include "base/callback.h"
#include "content/common/content_export.h"
#include "content/public/browser/navigation_controller.h"
-
-class SkBitmap;
+#include "third_party/skia/include/core/SkBitmap.h"
+#include "ui/gfx/rect.h"
namespace cc {
class Layer;
@@ -32,6 +32,10 @@ class WindowAndroid;
namespace content {
class WebContents;
+typedef base::Callback<void(SkBitmap*& bitmap,
+ const gfx::Size&,
+ SkBitmap::Config)> BitmapAllocator;
+
// Native side of the ContentViewCore.java, which is the primary way of
// communicating with the native Chromium code on Android. This is a
// public interface used by native code outside of the content module.
@@ -53,10 +57,17 @@ class CONTENT_EXPORT ContentViewCore {
// Request a scaled content readback. The result is passed through the
// callback. The boolean parameter indicates whether the readback was a
// success or not. The content is passed through the SkBitmap parameter.
- // |out_size| is returned with the size of the content.
+ // |bitmap_config| is optional parameter to specify the configuration of the
+ // output bitmap.
+ // |bounding_rect| is optional parameter to specify the bounds of the capture.
+ // |bitmap_allocator| is optional parameter to specify custom bitmap allocator
+ // to be used while sending back the bitmap.
virtual void GetScaledContentBitmap(
float scale,
- const base::Callback<void(bool, const SkBitmap&)>& result_callback) = 0;
+ const base::Callback<void(bool, const SkBitmap&)>& result_callback,
+ SkBitmap::Config bitmap_config = SkBitmap::kARGB_8888_Config,
+ const gfx::Rect& bounding_rect = gfx::Rect(),
+ const BitmapAllocator bitmap_allocator = BitmapAllocator()) = 0;
virtual float GetDpiScale() const = 0;
virtual void PauseVideo() = 0;
virtual void PauseOrResumeGeolocation(bool should_pause) = 0;

Powered by Google App Engine
This is Rietveld 408576698