summaryrefslogtreecommitdiffstats
path: root/ui/surface/accelerated_surface_win.h
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-04 01:43:56 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-04 01:43:56 +0000
commitd830fd4d83c1170ed2413308da48c0096bfd562e (patch)
treef88fc8c92aaadd5a084eaa8706620cb62180d48f /ui/surface/accelerated_surface_win.h
parent8d790d6a43fed99c3614634410f226f8497f30bc (diff)
downloadchromium_src-d830fd4d83c1170ed2413308da48c0096bfd562e.zip
chromium_src-d830fd4d83c1170ed2413308da48c0096bfd562e.tar.gz
chromium_src-d830fd4d83c1170ed2413308da48c0096bfd562e.tar.bz2
Windows: AcceleratedSurface presents with GDI while the window is being resized.
Presenting with Direct3D while the window resizes causes regions of the top level window that are rendered with GDI, like the title bar, to flicker visible / invisible. So use GDI across the board when resizing and switch back to Direct3D afterwards. BUG=120904 Review URL: https://chromiumcodereview.appspot.com/10990119 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@160042 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/surface/accelerated_surface_win.h')
-rw-r--r--ui/surface/accelerated_surface_win.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/ui/surface/accelerated_surface_win.h b/ui/surface/accelerated_surface_win.h
index 20c8f9e..5fc3de0 100644
--- a/ui/surface/accelerated_surface_win.h
+++ b/ui/surface/accelerated_surface_win.h
@@ -57,7 +57,7 @@ class SURFACE_EXPORT AcceleratedPresenter
void ReleaseSurface();
// The public member functions are called on the main thread.
- bool Present(HDC dc);
+ void Present(HDC dc);
bool CopyTo(const gfx::Rect& src_subrect,
const gfx::Size& dst_size,
void* buf);
@@ -81,10 +81,18 @@ class SURFACE_EXPORT AcceleratedPresenter
int64 surface_handle,
const CompletionTask& completion_task);
void DoSuspend();
- void DoPresent(HDC dc, bool* presented);
- bool DoRealPresent(HDC dc);
+ void DoPresent(const base::Closure& composite_task);
void DoReleaseSurface();
+ void PresentWithGDI(HDC dc);
+ gfx::Size GetWindowSize();
+
+ // This function tries to guess whether Direct3D will be able to reliably
+ // present to the window. When the window is resizing, presenting with
+ // Direct3D causes other regions of the window rendered with GDI to
+ // flicker transparent / non-transparent.
+ bool CheckDirect3DWillWork();
+
// The thread with which this presenter has affinity.
PresentThread* const present_thread_;
@@ -120,6 +128,13 @@ class SURFACE_EXPORT AcceleratedPresenter
// last hidden.
bool hidden_;
+ // These are used to detect when the window is resizing. For some reason,
+ // presenting with D3D while the window resizes causes those parts not
+ // drawn with D3D (e.g. with GDI) to flicker visible / invisible.
+ // http://crbug.com/120904
+ gfx::Size last_window_size_;
+ base::Time last_window_resize_time_;
+
DISALLOW_COPY_AND_ASSIGN(AcceleratedPresenter);
};
@@ -129,7 +144,7 @@ class SURFACE_EXPORT AcceleratedSurface {
~AcceleratedSurface();
// Synchronously present a frame with no acknowledgement.
- bool Present(HDC dc);
+ void Present(HDC dc);
// Copies the surface data to |buf|. The copied region is specified with
// |src_subrect| and the image data is transformed so that it fits in