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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 11108004: Android Browser Compositor: Add ScheduleComposite() callback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/renderer_host/render_widget_host_view_android.h" 5 #include "content/browser/renderer_host/render_widget_host_view_android.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
11 #include "content/browser/android/content_view_core_impl.h" 11 #include "content/browser/android/content_view_core_impl.h"
12 #include "content/browser/android/draw_delegate_impl.h" 12 #include "content/browser/android/draw_delegate_impl.h"
13 #include "content/browser/gpu/gpu_surface_tracker.h" 13 #include "content/browser/gpu/gpu_surface_tracker.h"
14 #include "content/browser/renderer_host/compositor_impl_android.h" 14 #include "content/browser/renderer_host/compositor_impl_android.h"
15 #include "content/browser/renderer_host/image_transport_factory_android.h" 15 #include "content/browser/renderer_host/image_transport_factory_android.h"
16 #include "content/browser/renderer_host/render_widget_host_impl.h" 16 #include "content/browser/renderer_host/render_widget_host_impl.h"
17 #include "content/common/android/device_info.h" 17 #include "content/common/android/device_info.h"
18 #include "content/common/gpu/gpu_messages.h" 18 #include "content/common/gpu/gpu_messages.h"
19 #include "content/common/view_messages.h" 19 #include "content/common/view_messages.h"
20 #include "third_party/WebKit/Source/Platform/chromium/public/Platform.h"
21 #include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorSuppor t.h"
20 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" 22 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h"
21 23
22 namespace content { 24 namespace content {
23 25
24 namespace { 26 namespace {
25 27
26 // TODO(pliard): http://crbug.com/142585. Remove this helper function and update 28 // TODO(pliard): http://crbug.com/142585. Remove this helper function and update
27 // the clients to deal directly with WebKit::WebTextDirection. 29 // the clients to deal directly with WebKit::WebTextDirection.
28 base::i18n::TextDirection ConvertTextDirection(WebKit::WebTextDirection dir) { 30 base::i18n::TextDirection ConvertTextDirection(WebKit::WebTextDirection dir) {
29 switch (dir) { 31 switch (dir) {
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 308
307 void RenderWidgetHostViewAndroid::AcceleratedSurfaceBuffersSwapped( 309 void RenderWidgetHostViewAndroid::AcceleratedSurfaceBuffersSwapped(
308 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, 310 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params,
309 int gpu_host_id) { 311 int gpu_host_id) {
310 texture_layer_->setTextureId(params.surface_handle); 312 texture_layer_->setTextureId(params.surface_handle);
311 texture_layer_->layer()->invalidate(); 313 texture_layer_->layer()->invalidate();
312 // TODO(sievers): The view and layer should get sized proactively. 314 // TODO(sievers): The view and layer should get sized proactively.
313 if (((gfx::Size)texture_layer_->layer()->bounds()).IsEmpty()) 315 if (((gfx::Size)texture_layer_->layer()->bounds()).IsEmpty())
314 texture_layer_->layer()->setBounds( 316 texture_layer_->layer()->setBounds(
315 DrawDelegateImpl::GetInstance()->GetBounds()); 317 DrawDelegateImpl::GetInstance()->GetBounds());
316 DrawDelegateImpl::GetInstance()->OnSurfaceUpdated( 318
317 params.surface_handle, 319 // TODO(sievers): When running the impl thread in the browser we
318 this, 320 // need to delay the ACK until after commit.
319 base::Bind(&RenderWidgetHostImpl::AcknowledgeBufferPresent, 321 DCHECK(!WebKit::Platform::current()->compositorSupport()->
320 params.route_id, gpu_host_id)); 322 isThreadingEnabled());
323 uint32 sync_point =
324 ImageTransportFactoryAndroid::GetInstance()->InsertSyncPoint();
no sievers 2012/10/12 21:33:07 @piman: One thing: Isn't it a problem that I inser
325 RenderWidgetHostImpl::AcknowledgeBufferPresent(
326 params.route_id, gpu_host_id, sync_point);
321 } 327 }
322 328
323 void RenderWidgetHostViewAndroid::AcceleratedSurfacePostSubBuffer( 329 void RenderWidgetHostViewAndroid::AcceleratedSurfacePostSubBuffer(
324 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, 330 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params,
325 int gpu_host_id) { 331 int gpu_host_id) {
326 NOTREACHED(); 332 NOTREACHED();
327 } 333 }
328 334
329 void RenderWidgetHostViewAndroid::AcceleratedSurfaceSuspend() { 335 void RenderWidgetHostViewAndroid::AcceleratedSurfaceSuspend() {
330 NOTREACHED(); 336 NOTREACHED();
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 // RenderWidgetHostView, public: 508 // RenderWidgetHostView, public:
503 509
504 // static 510 // static
505 RenderWidgetHostView* 511 RenderWidgetHostView*
506 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { 512 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) {
507 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); 513 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget);
508 return new RenderWidgetHostViewAndroid(rwhi, NULL); 514 return new RenderWidgetHostViewAndroid(rwhi, NULL);
509 } 515 }
510 516
511 } // namespace content 517 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698