| 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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 ContentViewCoreImpl* content_view_core) | 421 ContentViewCoreImpl* content_view_core) |
| 422 : host_(widget_host), | 422 : host_(widget_host), |
| 423 begin_frame_source_(nullptr), | 423 begin_frame_source_(nullptr), |
| 424 outstanding_begin_frame_requests_(0), | 424 outstanding_begin_frame_requests_(0), |
| 425 is_showing_(!widget_host->is_hidden()), | 425 is_showing_(!widget_host->is_hidden()), |
| 426 is_window_visible_(true), | 426 is_window_visible_(true), |
| 427 is_window_activity_started_(true), | 427 is_window_activity_started_(true), |
| 428 is_in_vr_(false), | 428 is_in_vr_(false), |
| 429 content_view_core_(nullptr), | 429 content_view_core_(nullptr), |
| 430 ime_adapter_android_(this), | 430 ime_adapter_android_(this), |
| 431 background_color_(SK_ColorWHITE), |
| 431 cached_background_color_(SK_ColorWHITE), | 432 cached_background_color_(SK_ColorWHITE), |
| 432 last_compositor_frame_sink_id_(kUndefinedCompositorFrameSinkId), | 433 last_compositor_frame_sink_id_(kUndefinedCompositorFrameSinkId), |
| 433 gesture_provider_(ui::GetGestureProviderConfig( | 434 gesture_provider_(ui::GetGestureProviderConfig( |
| 434 ui::GestureProviderConfigType::CURRENT_PLATFORM), | 435 ui::GestureProviderConfigType::CURRENT_PLATFORM), |
| 435 this), | 436 this), |
| 436 stylus_text_selector_(this), | 437 stylus_text_selector_(this), |
| 437 using_browser_compositor_(CompositorImpl::IsInitialized()), | 438 using_browser_compositor_(CompositorImpl::IsInitialized()), |
| 438 synchronous_compositor_client_(nullptr), | 439 synchronous_compositor_client_(nullptr), |
| 439 frame_evictor_(new DelegatedFrameEvictor(this)), | 440 frame_evictor_(new DelegatedFrameEvictor(this)), |
| 440 observing_root_window_(false), | 441 observing_root_window_(false), |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 913 | 914 |
| 914 delete this; | 915 delete this; |
| 915 } | 916 } |
| 916 | 917 |
| 917 void RenderWidgetHostViewAndroid::SetTooltipText( | 918 void RenderWidgetHostViewAndroid::SetTooltipText( |
| 918 const base::string16& tooltip_text) { | 919 const base::string16& tooltip_text) { |
| 919 // Tooltips don't makes sense on Android. | 920 // Tooltips don't makes sense on Android. |
| 920 } | 921 } |
| 921 | 922 |
| 922 void RenderWidgetHostViewAndroid::SetBackgroundColor(SkColor color) { | 923 void RenderWidgetHostViewAndroid::SetBackgroundColor(SkColor color) { |
| 923 RenderWidgetHostViewBase::SetBackgroundColor(color); | 924 background_color_ = color; |
| 924 host_->SetBackgroundOpaque(GetBackgroundOpaque()); | 925 |
| 926 DCHECK(SkColorGetA(color) == SK_AlphaOPAQUE || |
| 927 SkColorGetA(color) == SK_AlphaTRANSPARENT); |
| 928 host_->SetBackgroundOpaque(SkColorGetA(color) == SK_AlphaOPAQUE); |
| 925 UpdateBackgroundColor(color); | 929 UpdateBackgroundColor(color); |
| 926 } | 930 } |
| 927 | 931 |
| 932 SkColor RenderWidgetHostViewAndroid::background_color() const { |
| 933 return background_color_; |
| 934 } |
| 935 |
| 928 void RenderWidgetHostViewAndroid::CopyFromCompositingSurface( | 936 void RenderWidgetHostViewAndroid::CopyFromCompositingSurface( |
| 929 const gfx::Rect& src_subrect, | 937 const gfx::Rect& src_subrect, |
| 930 const gfx::Size& dst_size, | 938 const gfx::Size& dst_size, |
| 931 const ReadbackRequestCallback& callback, | 939 const ReadbackRequestCallback& callback, |
| 932 const SkColorType preferred_color_type) { | 940 const SkColorType preferred_color_type) { |
| 933 TRACE_EVENT0("cc", "RenderWidgetHostViewAndroid::CopyFromCompositingSurface"); | 941 TRACE_EVENT0("cc", "RenderWidgetHostViewAndroid::CopyFromCompositingSurface"); |
| 934 if (!host_ || !IsSurfaceAvailableForCopy()) { | 942 if (!host_ || !IsSurfaceAvailableForCopy()) { |
| 935 callback.Run(SkBitmap(), READBACK_SURFACE_UNAVAILABLE); | 943 callback.Run(SkBitmap(), READBACK_SURFACE_UNAVAILABLE); |
| 936 return; | 944 return; |
| 937 } | 945 } |
| (...skipping 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1992 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); | 2000 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); |
| 1993 if (!compositor) | 2001 if (!compositor) |
| 1994 return; | 2002 return; |
| 1995 | 2003 |
| 1996 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( | 2004 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( |
| 1997 overscroll_refresh_handler, compositor, | 2005 overscroll_refresh_handler, compositor, |
| 1998 ui::GetScaleFactorForNativeView(GetNativeView())); | 2006 ui::GetScaleFactorForNativeView(GetNativeView())); |
| 1999 } | 2007 } |
| 2000 | 2008 |
| 2001 } // namespace content | 2009 } // namespace content |
| OLD | NEW |