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

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

Issue 2773433003: Fix CompositorResizeLock to do something. (Closed)
Patch Set: resizelock: observer-rebase 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 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 bed917fff9cc40c3d506b3f840f94c604b5b41e6..1159f8bcc21eba6260b0f8163c6835c827362467 100644
--- a/content/browser/renderer_host/delegated_frame_host.cc
+++ b/content/browser/renderer_host/delegated_frame_host.cc
@@ -26,8 +26,8 @@
#include "components/display_compositor/gl_helper.h"
#include "content/browser/compositor/surface_utils.h"
#include "content/browser/gpu/compositor_util.h"
+#include "content/browser/renderer_host/compositor_resize_lock.h"
#include "content/browser/renderer_host/render_widget_host_view_frame_subscriber.h"
-#include "content/browser/renderer_host/resize_lock.h"
#include "content/public/common/content_switches.h"
#include "media/base/video_frame.h"
#include "media/base/video_util.h"
@@ -66,7 +66,7 @@ void DelegatedFrameHost::WasShown(const ui::LatencyInfo& latency_info) {
if (!has_frame_ && !released_front_lock_.get()) {
if (compositor_)
- released_front_lock_ = compositor_->GetCompositorLock();
+ released_front_lock_ = compositor_->GetCompositorLock(nullptr);
}
if (compositor_) {
@@ -95,8 +95,11 @@ void DelegatedFrameHost::MaybeCreateResizeLock() {
if (can_lock_compositor_ == YES_CAN_LOCK)
can_lock_compositor_ = YES_DID_LOCK;
- resize_lock_ =
- client_->DelegatedFrameHostCreateResizeLock(defer_compositor_lock);
+ resize_lock_ = client_->DelegatedFrameHostCreateResizeLock();
+ if (!defer_compositor_lock) {
+ bool locked = resize_lock_->Lock();
+ DCHECK(locked);
+ }
}
bool DelegatedFrameHost::ShouldCreateResizeLock() {
@@ -720,7 +723,7 @@ void DelegatedFrameHost::CopyFromCompositingSurfaceHasResultForVideo(
void DelegatedFrameHost::OnCompositingDidCommit(ui::Compositor* compositor) {
if (can_lock_compositor_ == NO_PENDING_COMMIT) {
can_lock_compositor_ = YES_CAN_LOCK;
- if (resize_lock_.get() && resize_lock_->GrabDeferredLock())
+ if (resize_lock_ && resize_lock_->Lock())
can_lock_compositor_ = YES_DID_LOCK;
}
if (resize_lock_ &&
« no previous file with comments | « content/browser/renderer_host/delegated_frame_host.h ('k') | content/browser/renderer_host/delegated_frame_host_client_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698