summaryrefslogtreecommitdiffstats
path: root/content/port
diff options
context:
space:
mode:
authorjbates@chromium.org <jbates@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-26 01:01:07 +0000
committerjbates@chromium.org <jbates@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-26 01:01:07 +0000
commitc63b4d4f499671b7f55aa264e823ad521f5d6aae (patch)
tree36c62254048a0e3f82ac0f003905ae860db1a3cf /content/port
parent92adf1719ccb5f7734955998006bc22b03210723 (diff)
downloadchromium_src-c63b4d4f499671b7f55aa264e823ad521f5d6aae.zip
chromium_src-c63b4d4f499671b7f55aa264e823ad521f5d6aae.tar.gz
chromium_src-c63b4d4f499671b7f55aa264e823ad521f5d6aae.tar.bz2
Delete background tab IOSurfaces on Mac.
The deleting part is easy: just handle the AcceleratedSurfaceSuspend call by unrefing the IOSurface. The hard part is dealing with a NSView drawRect when we don't have the IOSurface (or software BackingStore). To solve this, I reuse the GetBackingStore code to wait for a new frame from the renderer. When the BuffersSwapped message arrives on the IO thread for Mac, an UpdateRect message is synthesized with the SwapBuffers data. The UpdateRect message wakes up the UI thread and allows GetBackingStore to resume. The accelerated path can have multiple frames in the pipeline, so it is rarely enough to just wait for the next UpdateRect. Instead, the GetBackingStore method is updated to wait up to 40ms to get the correctly-sized frame (whether it's accelerated or software). The original GetBackingStore code waits for a frame that matches current_size_. However, this CL makes GetBackingStore wait for a frame that matches the view_->GetViewBounds(). current_size_ is equal to the last UpdateRect, which may or may not match GetViewBounds. (Anyone know why the original code doesn't use GetViewBounds?) This allows us to recover from missing BackingStores or IOSurfaces if the renderer/GPU can produce a new frame within 40ms. We probably want to increase 40 to something like 60 or 100ms though because of the deep GPU pipeline. In addition, thanks to the blocking GetBackingStore, this fixes some additional bugs: - no more resize gutter jank on accelerated pages (Mac only for now, but should work on Windows with a followup patch). - no more white flash while resizing flicker-test2.html. BUG=117624,58782,85519,124328,106586 Review URL: https://chromiumcodereview.appspot.com/9980016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134033 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/port')
-rw-r--r--content/port/browser/render_widget_host_view_port.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/content/port/browser/render_widget_host_view_port.h b/content/port/browser/render_widget_host_view_port.h
index cf0d459..2c6b8cb 100644
--- a/content/port/browser/render_widget_host_view_port.h
+++ b/content/port/browser/render_widget_host_view_port.h
@@ -175,6 +175,11 @@ class CONTENT_EXPORT RenderWidgetHostViewPort : public RenderWidgetHostView {
// next swap buffers or post sub buffer.
virtual void AcceleratedSurfaceSuspend() = 0;
+ // Return true if the view has an accelerated surface that contains the last
+ // presented frame for the view. If |desired_size| is non-empty, true is
+ // returned only if the accelerated surface size matches.
+ virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) = 0;
+
#if defined(OS_MACOSX)
// Retrieve the bounds of the view, in cocoa view coordinates.
// If the UI scale factor is 2, |GetViewBounds()| will return a size of e.g.