| Index: content/browser/renderer_host/delegated_frame_host.cc
|
| diff --git a/content/browser/renderer_host/delegated_frame_host.cc b/content/browser/renderer_host/delegated_frame_host.cc
|
| index 413b7da9e5c53b5ff22305f17e2928acf74e399a..6fe6dc71846c46fada8c5b1adb18b15d5c4a476a 100644
|
| --- a/content/browser/renderer_host/delegated_frame_host.cc
|
| +++ b/content/browser/renderer_host/delegated_frame_host.cc
|
| @@ -87,7 +87,7 @@ DelegatedFrameHost::DelegatedFrameHost(const cc::FrameSinkId& frame_sink_id,
|
| void DelegatedFrameHost::WasShown(const ui::LatencyInfo& latency_info) {
|
| delegated_frame_evictor_->SetVisible(true);
|
|
|
| - if (local_frame_id_.is_null() && !released_front_lock_.get()) {
|
| + if (!local_frame_id_.is_valid() && !released_front_lock_.get()) {
|
| if (compositor_)
|
| released_front_lock_ = compositor_->GetCompositorLock();
|
| }
|
| @@ -216,14 +216,14 @@ cc::SurfaceId DelegatedFrameHost::SurfaceIdAtPoint(
|
| const gfx::Point& point,
|
| gfx::Point* transformed_point) {
|
| cc::SurfaceId surface_id(frame_sink_id_, local_frame_id_);
|
| - if (surface_id.is_null())
|
| + if (!surface_id.is_valid())
|
| return surface_id;
|
| cc::SurfaceHittest hittest(delegate, GetSurfaceManager());
|
| gfx::Transform target_transform;
|
| cc::SurfaceId target_local_frame_id =
|
| hittest.GetTargetSurfaceAtPoint(surface_id, point, &target_transform);
|
| *transformed_point = point;
|
| - if (!target_local_frame_id.is_null())
|
| + if (target_local_frame_id.is_valid())
|
| target_transform.TransformPoint(transformed_point);
|
| return target_local_frame_id;
|
| }
|
| @@ -233,7 +233,7 @@ bool DelegatedFrameHost::TransformPointToLocalCoordSpace(
|
| const cc::SurfaceId& original_surface,
|
| gfx::Point* transformed_point) {
|
| cc::SurfaceId surface_id(frame_sink_id_, local_frame_id_);
|
| - if (surface_id.is_null())
|
| + if (!surface_id.is_valid())
|
| return false;
|
| *transformed_point = point;
|
| if (original_surface == surface_id)
|
| @@ -248,7 +248,7 @@ bool DelegatedFrameHost::TransformPointToCoordSpaceForView(
|
| const gfx::Point& point,
|
| RenderWidgetHostViewBase* target_view,
|
| gfx::Point* transformed_point) {
|
| - if (local_frame_id_.is_null())
|
| + if (!local_frame_id_.is_valid())
|
| return false;
|
|
|
| return target_view->TransformPointToLocalCoordSpace(
|
| @@ -283,7 +283,7 @@ SkColor DelegatedFrameHost::GetGutterColor() const {
|
| }
|
|
|
| void DelegatedFrameHost::UpdateGutters() {
|
| - if (local_frame_id_.is_null()) {
|
| + if (!local_frame_id_.is_valid()) {
|
| right_gutter_.reset();
|
| bottom_gutter_.reset();
|
| return;
|
| @@ -481,9 +481,9 @@ void DelegatedFrameHost::SwapDelegatedFrame(uint32_t compositor_frame_sink_id,
|
| surface_factory_ =
|
| base::MakeUnique<cc::SurfaceFactory>(frame_sink_id_, manager, this);
|
| }
|
| - if (local_frame_id_.is_null() || frame_size != current_surface_size_ ||
|
| + if (!local_frame_id_.is_valid() || frame_size != current_surface_size_ ||
|
| frame_size_in_dip != current_frame_size_in_dip_) {
|
| - if (!local_frame_id_.is_null())
|
| + if (local_frame_id_.is_valid())
|
| surface_factory_->Destroy(local_frame_id_);
|
| local_frame_id_ = id_allocator_->GenerateId();
|
| surface_factory_->Create(local_frame_id_);
|
| @@ -538,7 +538,7 @@ void DelegatedFrameHost::SwapDelegatedFrame(uint32_t compositor_frame_sink_id,
|
| } else {
|
| can_lock_compositor_ = NO_PENDING_COMMIT;
|
| }
|
| - if (!local_frame_id_.is_null()) {
|
| + if (local_frame_id_.is_valid()) {
|
| delegated_frame_evictor_->SwappedFrame(
|
| client_->DelegatedFrameHostIsVisible());
|
| }
|
| @@ -546,7 +546,7 @@ void DelegatedFrameHost::SwapDelegatedFrame(uint32_t compositor_frame_sink_id,
|
| }
|
|
|
| void DelegatedFrameHost::ClearDelegatedFrame() {
|
| - if (!local_frame_id_.is_null())
|
| + if (local_frame_id_.is_valid())
|
| EvictDelegatedFrame();
|
| }
|
|
|
| @@ -597,7 +597,7 @@ void DelegatedFrameHost::SetBeginFrameSource(
|
|
|
| void DelegatedFrameHost::EvictDelegatedFrame() {
|
| client_->DelegatedFrameHostGetLayer()->SetShowSolidColorContent();
|
| - if (!local_frame_id_.is_null()) {
|
| + if (local_frame_id_.is_valid()) {
|
| surface_factory_->Destroy(local_frame_id_);
|
| local_frame_id_ = cc::LocalFrameId();
|
| }
|
| @@ -821,7 +821,7 @@ void DelegatedFrameHost::OnUpdateVSyncParameters(base::TimeTicks timebase,
|
| // DelegatedFrameHost, ImageTransportFactoryObserver implementation:
|
|
|
| void DelegatedFrameHost::OnLostResources() {
|
| - if (!local_frame_id_.is_null())
|
| + if (local_frame_id_.is_valid())
|
| EvictDelegatedFrame();
|
| idle_frame_subscriber_textures_.clear();
|
| yuv_readback_pipeline_.reset();
|
| @@ -837,7 +837,7 @@ DelegatedFrameHost::~DelegatedFrameHost() {
|
| ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
|
| factory->GetContextFactory()->RemoveObserver(this);
|
|
|
| - if (!local_frame_id_.is_null())
|
| + if (local_frame_id_.is_valid())
|
| surface_factory_->Destroy(local_frame_id_);
|
| factory->GetSurfaceManager()->UnregisterSurfaceFactoryClient(frame_sink_id_);
|
| factory->GetSurfaceManager()->InvalidateFrameSinkId(frame_sink_id_);
|
| @@ -877,7 +877,7 @@ void DelegatedFrameHost::ResetCompositor() {
|
| }
|
|
|
| void DelegatedFrameHost::LockResources() {
|
| - DCHECK(!local_frame_id_.is_null());
|
| + DCHECK(local_frame_id_.is_valid());
|
| delegated_frame_evictor_->LockFrame();
|
| }
|
|
|
| @@ -892,7 +892,7 @@ void DelegatedFrameHost::RequestCopyOfOutput(
|
| }
|
|
|
| void DelegatedFrameHost::UnlockResources() {
|
| - DCHECK(!local_frame_id_.is_null());
|
| + DCHECK(local_frame_id_.is_valid());
|
| delegated_frame_evictor_->UnlockFrame();
|
| }
|
|
|
| @@ -904,7 +904,7 @@ void DelegatedFrameHost::OnLayerRecreated(ui::Layer* old_layer,
|
| // The new_layer is the one that will be used by our Window, so that's the one
|
| // that should keep our frame. old_layer will be returned to the
|
| // RecreateLayer caller, and should have a copy.
|
| - if (!local_frame_id_.is_null()) {
|
| + if (local_frame_id_.is_valid()) {
|
| ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
|
| cc::SurfaceManager* manager = factory->GetSurfaceManager();
|
| new_layer->SetShowSurface(
|
|
|