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

Unified Diff: content/browser/android/content_view_core_impl.cc

Issue 88033002: Add RGB565 Texture readback support in gl_helper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Modified code as per the review comments. Created 7 years 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/browser/android/content_view_core_impl.cc
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc
index c612941aedad75a28fdfe369f220d85c98b91e32..c9f8d819ea78ee77773b8a6e411404c1bc089d41 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -176,7 +176,8 @@ ContentViewCoreImpl::ContentViewCoreImpl(JNIEnv* env, jobject obj,
view_android_(view_android),
window_android_(window_android),
device_orientation_(0),
- geolocation_needs_pause_(false) {
+ geolocation_needs_pause_(false),
+ bitmap_config_is_565_(false) {
CHECK(web_contents) <<
"A ContentViewCoreImpl should be created with a valid WebContents.";
@@ -1287,7 +1288,6 @@ jboolean ContentViewCoreImpl::PopulateBitmapFromCompositor(JNIEnv* env,
RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid();
if (!view)
return false;
-
return view->PopulateBitmapWithContents(jbitmap);
}
@@ -1634,6 +1634,30 @@ void ContentViewCoreImpl::SendOrientationChangeEventInternal() {
rvhi->SendOrientationChangeEvent(device_orientation_);
}
+static void recieveOutputBitmap(bool, const SkBitmap& bitmap)
+{
+ if(bitmap.isNull()){
+ return;
+ }
+}
+
+void ContentViewCoreImpl::PopulateBitmapAsync(gfx::Rect src_subrect,
+ gfx::Size dst_size,
+ bool readback_config_rgb565) {
+ RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid();
+ if (!view)
+ return ;
+ bitmap_config_is_565_ = readback_config_rgb565;
+ view->CopyFromCompositingSurface(src_subrect,
+ dst_size,
+ base::Bind(&recieveOutputBitmap));
+ bitmap_config_is_565_ = false;
+}
+
+bool ContentViewCoreImpl::IsReadBackConfig565()
+{
+ return bitmap_config_is_565_;
+}
// This is called for each ContentView.
jlong Init(JNIEnv* env, jobject obj,
jboolean hardware_accelerated,

Powered by Google App Engine
This is Rietveld 408576698