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

Unified Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 10823051: ContentShell rendering support on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address Ted's comments Created 8 years, 5 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/browser/renderer_host/render_widget_host_view_android.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index 0315bdcb473672b54006a4daa397fa712733e501..22e2021df0209c992f3a55d9a1b1d6925d973148 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -4,13 +4,16 @@
#include "content/browser/renderer_host/render_widget_host_view_android.h"
+#include "base/bind.h"
#include "base/logging.h"
#include "base/message_loop.h"
#include "base/utf_string_conversions.h"
#include "content/browser/android/content_view_core_impl.h"
+#include "content/browser/android/draw_delegate_impl.h"
#include "content/browser/gpu/gpu_surface_tracker.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/common/android/device_info.h"
+#include "content/common/gpu/gpu_messages.h"
#include "content/common/view_messages.h"
namespace content {
@@ -150,6 +153,10 @@ bool RenderWidgetHostViewAndroid::IsShowing() {
}
gfx::Rect RenderWidgetHostViewAndroid::GetViewBounds() const {
+ gfx::Size bounds = DrawDelegateImpl::GetInstance()->GetBounds();
+ if (!bounds.IsEmpty())
+ return gfx::Rect(bounds);
+
if (content_view_core_) {
return content_view_core_->GetBounds();
} else {
@@ -258,7 +265,11 @@ void RenderWidgetHostViewAndroid::OnAcceleratedCompositingStateChange() {
void RenderWidgetHostViewAndroid::AcceleratedSurfaceBuffersSwapped(
const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params,
int gpu_host_id) {
- NOTREACHED();
+ DrawDelegateImpl::GetInstance()->OnSurfaceUpdated(
+ params.surface_handle,
+ this,
+ base::Bind(&RenderWidgetHostImpl::AcknowledgeBufferPresent,
+ params.route_id, gpu_host_id));
}
void RenderWidgetHostViewAndroid::AcceleratedSurfacePostSubBuffer(
@@ -284,6 +295,11 @@ void RenderWidgetHostViewAndroid::StartContentIntent(
}
gfx::GLSurfaceHandle RenderWidgetHostViewAndroid::GetCompositingSurface() {
+ gfx::GLSurfaceHandle handle =
+ DrawDelegateImpl::GetInstance()->GetDrawSurface();
+ if (!handle.is_null())
+ return handle;
+
// On Android, we cannot generate a window handle that can be passed to the
// GPU process through the native side. Instead, we send the surface handle
// through Binder after the compositing context has been created.

Powered by Google App Engine
This is Rietveld 408576698