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

Unified Diff: content/browser/renderer_host/delegated_frame_host.cc

Issue 2425923003: Replaced is_null() with is_valid in SurfaceId and related classes. (Closed)
Patch Set: Rebase Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
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 c922d8a282eaa0c2ceea12ae5ec23c70380f2edb..9505792fd0c14a225865dafd7ca08cd099daf730 100644
--- a/content/browser/renderer_host/delegated_frame_host.cc
+++ b/content/browser/renderer_host/delegated_frame_host.cc
@@ -89,7 +89,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();
}
@@ -218,14 +218,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;
}
@@ -235,7 +235,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)
@@ -250,7 +250,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(
@@ -285,7 +285,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;
@@ -389,7 +389,7 @@ void DelegatedFrameHost::AttemptFrameSubscriberCapture(
subscriber_texture->target()));
}
- if (!local_frame_id_.is_null()) {
+ if (local_frame_id_.is_valid()) {
// To avoid unnecessary composites, go directly to the Surface rather than
// through RequestCopyOfOutput (which goes through the browser
// compositor).
@@ -476,9 +476,9 @@ void DelegatedFrameHost::SwapDelegatedFrame(uint32_t compositor_frame_sink_id,
} else {
ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
cc::SurfaceManager* manager = factory->GetSurfaceManager();
- 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_);
@@ -533,7 +533,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());
}
@@ -541,7 +541,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();
}
@@ -592,7 +592,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();
}
@@ -814,7 +814,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();
@@ -828,7 +828,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_);
@@ -868,7 +868,7 @@ void DelegatedFrameHost::ResetCompositor() {
}
void DelegatedFrameHost::LockResources() {
- DCHECK(!local_frame_id_.is_null());
+ DCHECK(local_frame_id_.is_valid());
delegated_frame_evictor_->LockFrame();
}
@@ -883,7 +883,7 @@ void DelegatedFrameHost::RequestCopyOfOutput(
}
void DelegatedFrameHost::UnlockResources() {
- DCHECK(!local_frame_id_.is_null());
+ DCHECK(local_frame_id_.is_valid());
delegated_frame_evictor_->UnlockFrame();
}

Powered by Google App Engine
This is Rietveld 408576698