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

Unified Diff: android_webview/browser/renderer_host/aw_render_view_host_ext.cc

Issue 14888002: Android WebView Merged-Thread Hardware Draw (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 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: android_webview/browser/renderer_host/aw_render_view_host_ext.cc
diff --git a/android_webview/browser/renderer_host/aw_render_view_host_ext.cc b/android_webview/browser/renderer_host/aw_render_view_host_ext.cc
index 09553087a57b56df86d5178dedc9d9f70817ad10..a14fee1083546c41adfb76bb18e6e388044241c7 100644
--- a/android_webview/browser/renderer_host/aw_render_view_host_ext.cc
+++ b/android_webview/browser/renderer_host/aw_render_view_host_ext.cc
@@ -6,15 +6,19 @@
#include "android_webview/browser/aw_browser_context.h"
#include "android_webview/browser/scoped_allow_wait_for_legacy_web_view_api.h"
+#include "android_webview/common/aw_switches.h"
#include "android_webview/common/render_view_messages.h"
#include "base/android/scoped_java_ref.h"
#include "base/callback.h"
+#include "base/command_line.h"
#include "base/logging.h"
+#include "content/public/browser/android/content_view_core.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/user_metrics.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/frame_navigate_params.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositorInputHandler.h"
namespace android_webview {
@@ -105,6 +109,8 @@ bool AwRenderViewHostExt::OnMessageReceived(const IPC::Message& message) {
OnDocumentHasImagesResponse)
IPC_MESSAGE_HANDLER(AwViewHostMsg_UpdateHitTestData,
OnUpdateHitTestData)
+ IPC_MESSAGE_HANDLER(AwViewHostMsg_DidActivateAcceleratedCompositing,
+ OnDidActivateAcceleratedCompositing)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -131,4 +137,25 @@ void AwRenderViewHostExt::OnUpdateHitTestData(
has_new_hit_test_data_ = true;
}
+void AwRenderViewHostExt::OnDidActivateAcceleratedCompositing(
+ int input_handler_id) {
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kNoMergeUIAndRendererCompositorThreads)) {
+ return;
+ }
+
+ // This call is only meaningful and thread-safe when the UI and renderer
+ // compositor share the same thread. Any other case will likely yield
+ // terrible, terrible damage.
+ WebKit::WebCompositorInputHandler* input_handler =
+ WebKit::WebCompositorInputHandler::fromIdentifier(input_handler_id);
+ if (!input_handler)
+ return;
+
+ content::ContentViewCore* content_view_core
+ = content::ContentViewCore::FromWebContents(web_contents());
+ if (content_view_core)
+ content_view_core->SetInputHandler(input_handler);
+}
+
} // namespace android_webview

Powered by Google App Engine
This is Rietveld 408576698