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

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: Patch for RGB565 format texture readback in gl_helper 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 fd808fed4f3841f3f33587219fac6f21bad1c076..f4d2aa16457325521aaa5ecb02dcb3a76b787e3e 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -175,7 +175,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.";
@@ -1278,7 +1279,6 @@ jboolean ContentViewCoreImpl::PopulateBitmapFromCompositor(JNIEnv* env,
RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid();
if (!view)
return false;
-
return view->PopulateBitmapWithContents(jbitmap);
}
@@ -1625,6 +1625,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