OLD | NEW |
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 <android/bitmap.h> | 7 #include <android/bitmap.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 synchronous_compositor_client_(nullptr), | 439 synchronous_compositor_client_(nullptr), |
440 frame_evictor_(new DelegatedFrameEvictor(this)), | 440 frame_evictor_(new DelegatedFrameEvictor(this)), |
441 observing_root_window_(false), | 441 observing_root_window_(false), |
442 prev_top_shown_pix_(0.f), | 442 prev_top_shown_pix_(0.f), |
443 prev_bottom_shown_pix_(0.f), | 443 prev_bottom_shown_pix_(0.f), |
444 weak_ptr_factory_(this) { | 444 weak_ptr_factory_(this) { |
445 // Set the layer which will hold the content layer for this view. The content | 445 // Set the layer which will hold the content layer for this view. The content |
446 // layer is managed by the DelegatedFrameHost. | 446 // layer is managed by the DelegatedFrameHost. |
447 view_.SetLayer(cc::Layer::Create()); | 447 view_.SetLayer(cc::Layer::Create()); |
448 if (using_browser_compositor_) { | 448 if (using_browser_compositor_) { |
449 // This FrameSinkId must be unique with ContextProviderFactory's FrameSinkId | 449 cc::FrameSinkId frame_sink_id = |
450 // allocation. | 450 host_->AllocateFrameSinkId(false /* is_guest_view_hack */); |
451 // TODO(crbug.com/685777): Centralize allocation in one place for easier | |
452 // maintenance. | |
453 cc::FrameSinkId frame_sink_id = cc::FrameSinkId( | |
454 base::checked_cast<uint32_t>(host_->GetProcess()->GetID()), | |
455 base::checked_cast<uint32_t>(host_->GetRoutingID())); | |
456 delegated_frame_host_.reset(new ui::DelegatedFrameHostAndroid( | 451 delegated_frame_host_.reset(new ui::DelegatedFrameHostAndroid( |
457 &view_, cached_background_color_, this, frame_sink_id)); | 452 &view_, cached_background_color_, this, frame_sink_id)); |
458 } | 453 } |
459 | 454 |
460 host_->SetView(this); | 455 host_->SetView(this); |
461 SetContentViewCore(content_view_core); | 456 SetContentViewCore(content_view_core); |
462 | 457 |
463 CreateOverscrollControllerIfPossible(); | 458 CreateOverscrollControllerIfPossible(); |
464 | 459 |
465 if (GetTextInputManager()) | 460 if (GetTextInputManager()) |
(...skipping 1532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1998 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); | 1993 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); |
1999 if (!compositor) | 1994 if (!compositor) |
2000 return; | 1995 return; |
2001 | 1996 |
2002 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( | 1997 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( |
2003 overscroll_refresh_handler, compositor, | 1998 overscroll_refresh_handler, compositor, |
2004 ui::GetScaleFactorForNativeView(GetNativeView())); | 1999 ui::GetScaleFactorForNativeView(GetNativeView())); |
2005 } | 2000 } |
2006 | 2001 |
2007 } // namespace content | 2002 } // namespace content |
OLD | NEW |