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

Side by Side Diff: content/browser/android/content_view_core_impl.cc

Issue 593503003: Support error handling for Surface readbacks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Formatted code and fixed build issue in test. Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/android/content_view_core_impl.h" 5 #include "content/browser/android/content_view_core_impl.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 return; 626 return;
627 Java_ContentViewCore_showPastePopupWithFeedback(env, obj.obj(), 627 Java_ContentViewCore_showPastePopupWithFeedback(env, obj.obj(),
628 static_cast<jint>(x_dip), 628 static_cast<jint>(x_dip),
629 static_cast<jint>(y_dip)); 629 static_cast<jint>(y_dip));
630 } 630 }
631 631
632 void ContentViewCoreImpl::GetScaledContentBitmap( 632 void ContentViewCoreImpl::GetScaledContentBitmap(
633 float scale, 633 float scale,
634 SkColorType color_type, 634 SkColorType color_type,
635 gfx::Rect src_subrect, 635 gfx::Rect src_subrect,
636 const base::Callback<void(bool, const SkBitmap&)>& result_callback) { 636 ReadbackRequestCallback& result_callback) {
637 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); 637 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid();
638 if (!view) { 638 if (!view) {
639 result_callback.Run(false, SkBitmap()); 639 result_callback.Run(SkBitmap(), READBACK_FAILED);
640 return; 640 return;
641 } 641 }
642 642
643 view->GetScaledContentBitmap(scale, color_type, src_subrect, 643 view->GetScaledContentBitmap(scale, color_type, src_subrect,
644 result_callback); 644 result_callback);
645 } 645 }
646 646
647 void ContentViewCoreImpl::StartContentIntent(const GURL& content_url) { 647 void ContentViewCoreImpl::StartContentIntent(const GURL& content_url) {
648 JNIEnv* env = AttachCurrentThread(); 648 JNIEnv* env = AttachCurrentThread();
649 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); 649 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env);
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
1325 reinterpret_cast<ui::WindowAndroid*>(window_android), 1325 reinterpret_cast<ui::WindowAndroid*>(window_android),
1326 retained_objects_set); 1326 retained_objects_set);
1327 return reinterpret_cast<intptr_t>(view); 1327 return reinterpret_cast<intptr_t>(view);
1328 } 1328 }
1329 1329
1330 bool RegisterContentViewCore(JNIEnv* env) { 1330 bool RegisterContentViewCore(JNIEnv* env) {
1331 return RegisterNativesImpl(env); 1331 return RegisterNativesImpl(env);
1332 } 1332 }
1333 1333
1334 } // namespace content 1334 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698