| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/frame_host/render_widget_host_view_child_frame.h" | 5 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 RenderWidgetHostViewChildFrame::RenderWidgetHostViewChildFrame( | 50 RenderWidgetHostViewChildFrame::RenderWidgetHostViewChildFrame( |
| 51 RenderWidgetHost* widget_host) | 51 RenderWidgetHost* widget_host) |
| 52 : host_(RenderWidgetHostImpl::From(widget_host)), | 52 : host_(RenderWidgetHostImpl::From(widget_host)), |
| 53 frame_sink_id_( | 53 frame_sink_id_( |
| 54 base::checked_cast<uint32_t>(widget_host->GetProcess()->GetID()), | 54 base::checked_cast<uint32_t>(widget_host->GetProcess()->GetID()), |
| 55 base::checked_cast<uint32_t>(widget_host->GetRoutingID())), | 55 base::checked_cast<uint32_t>(widget_host->GetRoutingID())), |
| 56 next_surface_sequence_(1u), | 56 next_surface_sequence_(1u), |
| 57 current_surface_scale_factor_(1.f), | 57 current_surface_scale_factor_(1.f), |
| 58 frame_connector_(nullptr), | 58 frame_connector_(nullptr), |
| 59 background_color_(SK_ColorWHITE), |
| 59 weak_factory_(this) { | 60 weak_factory_(this) { |
| 60 GetSurfaceManager()->RegisterFrameSinkId(frame_sink_id_); | 61 GetSurfaceManager()->RegisterFrameSinkId(frame_sink_id_); |
| 61 CreateCompositorFrameSinkSupport(); | 62 CreateCompositorFrameSinkSupport(); |
| 62 } | 63 } |
| 63 | 64 |
| 64 RenderWidgetHostViewChildFrame::~RenderWidgetHostViewChildFrame() { | 65 RenderWidgetHostViewChildFrame::~RenderWidgetHostViewChildFrame() { |
| 65 ResetCompositorFrameSinkSupport(); | 66 ResetCompositorFrameSinkSupport(); |
| 66 if (GetSurfaceManager()) | 67 if (GetSurfaceManager()) |
| 67 GetSurfaceManager()->InvalidateFrameSinkId(frame_sink_id_); | 68 GetSurfaceManager()->InvalidateFrameSinkId(frame_sink_id_); |
| 68 } | 69 } |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 return nullptr; | 205 return nullptr; |
| 205 } | 206 } |
| 206 | 207 |
| 207 gfx::NativeViewAccessible | 208 gfx::NativeViewAccessible |
| 208 RenderWidgetHostViewChildFrame::GetNativeViewAccessible() { | 209 RenderWidgetHostViewChildFrame::GetNativeViewAccessible() { |
| 209 NOTREACHED(); | 210 NOTREACHED(); |
| 210 return nullptr; | 211 return nullptr; |
| 211 } | 212 } |
| 212 | 213 |
| 213 void RenderWidgetHostViewChildFrame::SetBackgroundColor(SkColor color) { | 214 void RenderWidgetHostViewChildFrame::SetBackgroundColor(SkColor color) { |
| 214 RenderWidgetHostViewBase::SetBackgroundColor(color); | 215 background_color_ = color; |
| 215 bool opaque = GetBackgroundOpaque(); | 216 |
| 216 host_->SetBackgroundOpaque(opaque); | 217 DCHECK(SkColorGetA(color) == SK_AlphaOPAQUE || |
| 218 SkColorGetA(color) == SK_AlphaTRANSPARENT); |
| 219 host_->SetBackgroundOpaque(SkColorGetA(color) == SK_AlphaOPAQUE); |
| 220 } |
| 221 |
| 222 SkColor RenderWidgetHostViewChildFrame::background_color() const { |
| 223 return background_color_; |
| 217 } | 224 } |
| 218 | 225 |
| 219 gfx::Size RenderWidgetHostViewChildFrame::GetPhysicalBackingSize() const { | 226 gfx::Size RenderWidgetHostViewChildFrame::GetPhysicalBackingSize() const { |
| 220 gfx::Size size; | 227 gfx::Size size; |
| 221 if (frame_connector_) { | 228 if (frame_connector_) { |
| 222 content::ScreenInfo screen_info; | 229 content::ScreenInfo screen_info; |
| 223 host_->GetScreenInfo(&screen_info); | 230 host_->GetScreenInfo(&screen_info); |
| 224 size = gfx::ScaleToCeiledSize(frame_connector_->ChildFrameRect().size(), | 231 size = gfx::ScaleToCeiledSize(frame_connector_->ChildFrameRect().size(), |
| 225 screen_info.device_scale_factor); | 232 screen_info.device_scale_factor); |
| 226 } | 233 } |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 695 frame_sink_id_); | 702 frame_sink_id_); |
| 696 } | 703 } |
| 697 support_.reset(); | 704 support_.reset(); |
| 698 } | 705 } |
| 699 | 706 |
| 700 bool RenderWidgetHostViewChildFrame::HasEmbedderChanged() { | 707 bool RenderWidgetHostViewChildFrame::HasEmbedderChanged() { |
| 701 return false; | 708 return false; |
| 702 } | 709 } |
| 703 | 710 |
| 704 } // namespace content | 711 } // namespace content |
| OLD | NEW |