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

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

Issue 2702153003: [content] Fix background color update handling in RWHVAura. (Closed)
Patch Set: add back static_casts since compile complains otherwise. Created 3 years, 9 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
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 <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
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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
907 908
908 delete this; 909 delete this;
909 } 910 }
910 911
911 void RenderWidgetHostViewAndroid::SetTooltipText( 912 void RenderWidgetHostViewAndroid::SetTooltipText(
912 const base::string16& tooltip_text) { 913 const base::string16& tooltip_text) {
913 // Tooltips don't makes sense on Android. 914 // Tooltips don't makes sense on Android.
914 } 915 }
915 916
916 void RenderWidgetHostViewAndroid::SetBackgroundColor(SkColor color) { 917 void RenderWidgetHostViewAndroid::SetBackgroundColor(SkColor color) {
917 RenderWidgetHostViewBase::SetBackgroundColor(color); 918 background_color_ = color;
918 host_->SetBackgroundOpaque(GetBackgroundOpaque()); 919
920 DCHECK(SkColorGetA(color) == SK_AlphaOPAQUE ||
921 SkColorGetA(color) == SK_AlphaTRANSPARENT);
922 host_->SetBackgroundOpaque(SkColorGetA(color) == SK_AlphaOPAQUE);
919 UpdateBackgroundColor(color); 923 UpdateBackgroundColor(color);
920 } 924 }
921 925
926 SkColor RenderWidgetHostViewAndroid::background_color() const {
927 return background_color_;
928 }
929
922 void RenderWidgetHostViewAndroid::CopyFromCompositingSurface( 930 void RenderWidgetHostViewAndroid::CopyFromCompositingSurface(
923 const gfx::Rect& src_subrect, 931 const gfx::Rect& src_subrect,
924 const gfx::Size& dst_size, 932 const gfx::Size& dst_size,
925 const ReadbackRequestCallback& callback, 933 const ReadbackRequestCallback& callback,
926 const SkColorType preferred_color_type) { 934 const SkColorType preferred_color_type) {
927 TRACE_EVENT0("cc", "RenderWidgetHostViewAndroid::CopyFromCompositingSurface"); 935 TRACE_EVENT0("cc", "RenderWidgetHostViewAndroid::CopyFromCompositingSurface");
928 if (!host_ || !IsSurfaceAvailableForCopy()) { 936 if (!host_ || !IsSurfaceAvailableForCopy()) {
929 callback.Run(SkBitmap(), READBACK_SURFACE_UNAVAILABLE); 937 callback.Run(SkBitmap(), READBACK_SURFACE_UNAVAILABLE);
930 return; 938 return;
931 } 939 }
(...skipping 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after
1986 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); 1994 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor();
1987 if (!compositor) 1995 if (!compositor)
1988 return; 1996 return;
1989 1997
1990 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( 1998 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>(
1991 overscroll_refresh_handler, compositor, 1999 overscroll_refresh_handler, compositor,
1992 ui::GetScaleFactorForNativeView(GetNativeView())); 2000 ui::GetScaleFactorForNativeView(GetNativeView()));
1993 } 2001 }
1994 2002
1995 } // namespace content 2003 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698