diff options
Diffstat (limited to 'content/browser/compositor')
-rw-r--r-- | content/browser/compositor/delegated_frame_host.cc | 14 | ||||
-rw-r--r-- | content/browser/compositor/delegated_frame_host.h | 4 |
2 files changed, 10 insertions, 8 deletions
diff --git a/content/browser/compositor/delegated_frame_host.cc b/content/browser/compositor/delegated_frame_host.cc index eddedf4..76e12e6 100644 --- a/content/browser/compositor/delegated_frame_host.cc +++ b/content/browser/compositor/delegated_frame_host.cc @@ -12,6 +12,7 @@ #include "cc/resources/single_release_callback.h" #include "cc/resources/texture_mailbox.h" #include "content/browser/compositor/resize_lock.h" +#include "content/common/gpu/client/gl_helper.h" #include "content/public/browser/render_widget_host_view_frame_subscriber.h" #include "content/public/common/content_switches.h" #include "media/base/video_frame.h" @@ -40,7 +41,7 @@ DelegatedFrameHost::DelegatedFrameHost(DelegatedFrameHostClient* client) last_output_surface_id_(0), pending_delegated_ack_count_(0), skipped_frames_(false), - can_lock_compositor_(YES), + can_lock_compositor_(YES_CAN_LOCK), delegated_frame_evictor_(new DelegatedFrameEvictor(this)) { ImageTransportFactory::GetInstance()->AddObserver(this); } @@ -76,15 +77,13 @@ void DelegatedFrameHost::MaybeCreateResizeLock() { can_lock_compositor_ == NO_PENDING_RENDERER_FRAME || can_lock_compositor_ == NO_PENDING_COMMIT; - if (can_lock_compositor_ == YES) + if (can_lock_compositor_ == YES_CAN_LOCK) can_lock_compositor_ = YES_DID_LOCK; resize_lock_ = client_->CreateResizeLock(defer_compositor_lock); } bool DelegatedFrameHost::ShouldCreateResizeLock() { - RenderWidgetHostImpl* host = client_->GetHost(); - // On Windows while resizing, the the resize locks makes us mis-paint a white // vertical strip (including the non-client area) if the content composition // is lagging the UI composition. So here we disable the throttling so that @@ -92,9 +91,12 @@ bool DelegatedFrameHost::ShouldCreateResizeLock() { // whiteout. Because this causes the content to be drawn at wrong sizes while // resizing we compensate by blocking the UI thread in Compositor::Draw() by // issuing a FinishAllRendering() if we are resizing. -#if defined(OS_WIN) + // TODO(ccameron): Mac browser window resizing is incompletely implemented. +#if defined(OS_WIN) || defined(OS_MACOSX) return false; #else + RenderWidgetHostImpl* host = client_->GetHost(); + if (resize_lock_) return false; @@ -724,7 +726,7 @@ void DelegatedFrameHost::OnCompositingDidCommit( ui::Compositor* compositor) { RenderWidgetHostImpl* host = client_->GetHost(); if (can_lock_compositor_ == NO_PENDING_COMMIT) { - can_lock_compositor_ = YES; + can_lock_compositor_ = YES_CAN_LOCK; if (resize_lock_.get() && resize_lock_->GrabDeferredLock()) can_lock_compositor_ = YES_DID_LOCK; } diff --git a/content/browser/compositor/delegated_frame_host.h b/content/browser/compositor/delegated_frame_host.h index 5b2588d..293314a 100644 --- a/content/browser/compositor/delegated_frame_host.h +++ b/content/browser/compositor/delegated_frame_host.h @@ -13,7 +13,6 @@ #include "content/browser/renderer_host/delegated_frame_evictor.h" #include "content/browser/renderer_host/dip_util.h" #include "content/browser/renderer_host/render_widget_host_impl.h" -#include "content/common/gpu/client/gl_helper.h" #include "content/public/browser/render_process_host.h" #include "ui/compositor/compositor.h" #include "ui/compositor/compositor_observer.h" @@ -29,6 +28,7 @@ class VideoFrame; namespace content { class DelegatedFrameHost; +class ReadbackYUVInterface; class RenderWidgetHostViewFrameSubscriber; class RenderWidgetHostImpl; class ResizeLock; @@ -258,7 +258,7 @@ class CONTENT_EXPORT DelegatedFrameHost scoped_refptr<ui::CompositorLock> released_front_lock_; enum CanLockCompositorState { - YES, + YES_CAN_LOCK, // We locked, so at some point we'll need to kick a frame. YES_DID_LOCK, // No. A lock timed out, we need to kick a new frame before locking again. |