| 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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 using_browser_compositor_(CompositorImpl::IsInitialized()), | 442 using_browser_compositor_(CompositorImpl::IsInitialized()), |
| 443 synchronous_compositor_client_(nullptr), | 443 synchronous_compositor_client_(nullptr), |
| 444 frame_evictor_(new DelegatedFrameEvictor(this)), | 444 frame_evictor_(new DelegatedFrameEvictor(this)), |
| 445 locks_on_frame_count_(0), | 445 locks_on_frame_count_(0), |
| 446 observing_root_window_(false), | 446 observing_root_window_(false), |
| 447 weak_ptr_factory_(this) { | 447 weak_ptr_factory_(this) { |
| 448 // Set the layer which will hold the content layer for this view. The content | 448 // Set the layer which will hold the content layer for this view. The content |
| 449 // layer is managed by the DelegatedFrameHost. | 449 // layer is managed by the DelegatedFrameHost. |
| 450 view_.SetLayer(cc::Layer::Create()); | 450 view_.SetLayer(cc::Layer::Create()); |
| 451 if (using_browser_compositor_) { | 451 if (using_browser_compositor_) { |
| 452 // This FrameSinkId must be unique with ContextProviderFactory's FrameSinkId |
| 453 // allocation. |
| 454 // TODO(crbug.com/685777): Centralize allocation in one place for easier |
| 455 // maintenance. |
| 456 cc::FrameSinkId frame_sink_id = cc::FrameSinkId( |
| 457 base::checked_cast<uint32_t>(host_->GetProcess()->GetID()), |
| 458 base::checked_cast<uint32_t>(host_->GetRoutingID())); |
| 452 delegated_frame_host_.reset(new ui::DelegatedFrameHostAndroid( | 459 delegated_frame_host_.reset(new ui::DelegatedFrameHostAndroid( |
| 453 &view_, cached_background_color_, this)); | 460 &view_, cached_background_color_, this, frame_sink_id)); |
| 454 } | 461 } |
| 455 | 462 |
| 456 host_->SetView(this); | 463 host_->SetView(this); |
| 457 SetContentViewCore(content_view_core); | 464 SetContentViewCore(content_view_core); |
| 458 | 465 |
| 459 CreateOverscrollControllerIfPossible(); | 466 CreateOverscrollControllerIfPossible(); |
| 460 | 467 |
| 461 if (GetTextInputManager()) | 468 if (GetTextInputManager()) |
| 462 GetTextInputManager()->AddObserver(this); | 469 GetTextInputManager()->AddObserver(this); |
| 463 } | 470 } |
| (...skipping 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2067 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); | 2074 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); |
| 2068 if (!compositor) | 2075 if (!compositor) |
| 2069 return; | 2076 return; |
| 2070 | 2077 |
| 2071 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( | 2078 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( |
| 2072 overscroll_refresh_handler, compositor, | 2079 overscroll_refresh_handler, compositor, |
| 2073 ui::GetScaleFactorForNativeView(GetNativeView())); | 2080 ui::GetScaleFactorForNativeView(GetNativeView())); |
| 2074 } | 2081 } |
| 2075 | 2082 |
| 2076 } // namespace content | 2083 } // namespace content |
| OLD | NEW |