summaryrefslogtreecommitdiffstats
path: root/content/browser/compositor
diff options
context:
space:
mode:
authorccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-13 01:00:35 +0000
committerccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-13 01:00:35 +0000
commit4232b250edef4e6325d792290af2895aac8cb8fe (patch)
tree1c28c72a9c2e4df125efa4d4520e37483a6dbad4 /content/browser/compositor
parent2c68be07377cb224e4c4f56549301352953cb2d4 (diff)
downloadchromium_src-4232b250edef4e6325d792290af2895aac8cb8fe.zip
chromium_src-4232b250edef4e6325d792290af2895aac8cb8fe.tar.gz
chromium_src-4232b250edef4e6325d792290af2895aac8cb8fe.tar.bz2
Make --enable-delegated-renderer show stuff on Mac
With this patch, pixels appear on screen and tab capture works. Add a OnNativeSurfaceBuffersSwapped mechanism to display an IOSurface to an NSView. This is wired up to the existing CompositingIOSurfaceMac. In a future refactoring, something much more light-weight than CompositingIOSurfaceMac will be used (CompositingIOSurfaceMac has capture code, etc, in it). Add a DelegatedFrameHost to RenderWidgetHostViewMac, and hookup the DelegatedFrameHostClient implementation. Create the DelegatedFrameHost when a delegated frame is received, and use its existence to determine which mode is active. BUG=314190 Review URL: https://codereview.chromium.org/267073003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269946 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/compositor')
-rw-r--r--content/browser/compositor/delegated_frame_host.cc14
-rw-r--r--content/browser/compositor/delegated_frame_host.h4
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.