summaryrefslogtreecommitdiffstats
path: root/ui/surface/accelerated_surface_win.h
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Revert 224496 "Move ui/base/latency_info* to ui/events""ben@chromium.org2013-09-231-1/+1
| | | | | | | | | | | | | This reverts commit d1ec3f7f30d07132bf0f75e4938d50a508bc7637. Attempt at re-landing this previous change. Moves LatencyInfo from ui/base to ui/events. TBR=sky@chromium.org,jamesr@chromium.org,jschuh@chromium.org BUG=none Review URL: https://codereview.chromium.org/24257011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@224769 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 224496 "Move ui/base/latency_info* to ui/events"ben@chromium.org2013-09-201-1/+1
| | | | | | | | | | | | | | | | | | > Move ui/base/latency_info* to ui/events > > Latest in a sequence of changes to extract ui/gfx as its own component and sever ties on ui/base from various should-be-lower-level components. > > TBR=jamesr@chromium.org, sky@chromium.org > > BUG=none > > Review URL: https://codereview.chromium.org/23464099 TBR=ben@chromium.org Review URL: https://codereview.chromium.org/24141009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@224503 0039d316-1c4b-4281-b951-d872f2087c98
* Move ui/base/latency_info* to ui/eventsben@chromium.org2013-09-201-1/+1
| | | | | | | | | | | | Latest in a sequence of changes to extract ui/gfx as its own component and sever ties on ui/base from various should-be-lower-level components. TBR=jamesr@chromium.org, sky@chromium.org BUG=none Review URL: https://codereview.chromium.org/23464099 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@224496 0039d316-1c4b-4281-b951-d872f2087c98
* Remove using the Shell desktop Window when we don't have an acceleated widget.cpu@chromium.org2013-08-301-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For Windows Ash (metro mode) we did not had timely access to the real window (aka 'core window') so to keep the compositor from CHECKIing we gave the shell desktop Window when it wanted a window here RootWindow::RootWindow(const CreateParams& params) { ... compositor_.reset(new ui::Compositor(this, host_->GetAcceleratedWidget())); ... } This was called from: ash::DisplayController::AddRootWindowForDisplay ash::DisplayController::InitPrimaryDisplay ash::Shell::Init Because ash was always created. Later on when the viewer process had started it sends an IPC back with the core window which set the real window with void ChromeMetroViewerProcessHost::OnSetTargetSurface(..) { scoped_refptr<AcceleratedPresenter> any_window = AcceleratedPresenter::GetForWindow(NULL); any_window->SetNewTargetWindow(hwnd); .... } All this hackery can go away because now Ash starts on demand once the aforementioned IPC arrives. BUG=none TEST=chromes starts in metro mode. Review URL: https://chromiumcodereview.appspot.com/22876030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@220694 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a race condition which could allow an accelerated surface to be read ↵zturner@chromium.org2013-07-171-0/+8
| | | | | | | | | | | | | | | | from before it had been presented to. The issue is caused by an insufficient check to determine when the surface is ready to be copied to. It is possible for the surface object to be created but not the swap chain. This CL requires that both the surface and the swap chain be created before the test can run. BUG=260438 @sky: content/browser/* @apatrick: ui/surface/* Review URL: https://chromiumcodereview.appspot.com/19286007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211961 0039d316-1c4b-4281-b951-d872f2087c98
* Use a direct include of time headers in ui/.avi@chromium.org2013-06-281-1/+1
| | | | | | | | | | BUG=254986 TEST=none TBR=ben@chromium.org Review URL: https://codereview.chromium.org/18149004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209153 0039d316-1c4b-4281-b951-d872f2087c98
* Pass LatencyInfo struct through win AcceleratedSurface.jbauman@chromium.org2013-06-011-1/+7
| | | | | | | | BUG=155367 Review URL: https://chromiumcodereview.appspot.com/16077007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203546 0039d316-1c4b-4281-b951-d872f2087c98
* Windows: Synchronize browser process D3D adapters with GPU process D3D adapters.apatrick@chromium.org2013-05-241-0/+2
| | | | | | | | | | | | | | | | Currently both processes use the primary D3D adapter. The primary D3D adapter can change, for example when the primary D3D adapter's monitor is disconnected. When this happens, the browser process can start using devices on a different adapter to the GPU process and texture sharing stops working, resulting in a black window. With this patch, the GPU process reports the LUID for the adapter it is using. Rather than using the primary adapter, the browser process decides which adapter to use by LUID. This depends on this ANGLE patch: https://codereview.appspot.com/9233044/ BUG=170875,236912 TEST=On a windows 7 machine, install an ATI GPU and an nVidia GPU with the nVidia as the primary one. Connect a monitor to each. Launch Chrome and go to a GPU accelerated page. Observe it work. Drag the window to the secondary display and disconnect the monitor from the primary (nVidia) GPU. The window should not turn black. Review URL: https://chromiumcodereview.appspot.com/14455011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202201 0039d316-1c4b-4281-b951-d872f2087c98
* Windows: fix failure to recover from device lost in AcceleratedSurface.apatrick@chromium.org2013-02-161-5/+4
| | | | | | | | | | | | | | | | | | When device lost is detected, null out or recreate all the resources and shaders used by the old device. They will not work on the new device. The old shaders created by the AcceleratedSurfaceTransformer need to be recreated. It should also recreate the shared texture and swap chain because they won't otherwise get recreated without window resizing and / or tab switching. I moved the lock from AcceleratedPresenter to PresentThread so that one AcceratedPresenter can destroy resources of others that use the same D3D device without risking deadlock. Check for device lost while polling the event query. Sometimes GetData does not seem to report the loss of the device. Also, treat S_PRESENT_MODE_CHANGED as a lost device because sometimes CheckDeviceState returns that after a GPU hang. I backed out the change to terminate the GPU process on any D3D errors in DoPresentAndAcknowledge. I don't think that was the real issue. BUG=170767,170875 Review URL: https://chromiumcodereview.appspot.com/12252053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182984 0039d316-1c4b-4281-b951-d872f2087c98
* Tab Capture: Backing store readbacks to YV12 VideoFrames.nick@chromium.org2013-02-111-8/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Goal here is performance; in tab capture there are significant benefits to doing the readback as YV12: it's less data to copy back, and it's cheap to do on the GPU. VideoFrame is used because it's the most capable YV12 container. [render_widget_host.h] Add a new flavor of CopyFromBackingStore, called CopyFromBackingStoreToVideoFrame. The semantics are slightly different from the RGBA copy in ways that are video-appropriate: aspect ratio is preserved via letterboxing, meaning the output is returned at the target's allocated size, no matter what (whereas CopyFromBackingStore returns whatever it wants, treating |dst_size| as a hint). Callers may only call CopyFromBackingStoreToVideoFrame after checking the result of CanCopyToVideoFrame(). Support is only on Windows now, and only while accelerated compositing is active. But the interface defined here should make it possible to implement VideoFrame readbacks on other platforms without having to touch the callers. [video_capture_controller.h] Amend the interface to allow a VideoFrame to be passed in, as an alternative to void*. The buffer-based interface was inadequate for our needs since stride was not handled. Using VideoFrame allows strides to be accomodated, and paves the way for the interface to pre-reserve the VideoFrames. [web_contents_video_capture_device.cc] Start using CopyFromBackingStoreToVideoFrame. Handling both copy flavors requires a bifurcation of much of the processing pipeline. When dealing with a VideoFrame, the Render stage can is bypassed completely. [accelerated_surface_win.h] Implementation of VideoFrame YV12 readback, using AcceleratedSurfaceTransformer's d3d-accelerated routines. BUG=161537 Review URL: https://chromiumcodereview.appspot.com/12090109 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181785 0039d316-1c4b-4281-b951-d872f2087c98
* Change PlatformBitmap memory ownership story. Fix CopyFromBackingStore ↵nick@chromium.org2013-02-021-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | threading issues. PlatformBitmap: restructure this class so that, on all platforms, it is safe to use an SkBitmap derived from the PlatformBitmap even after the PlatformBitmap is destroyed. In practice this means changes to Linux (use a different cairo creation routine that allows us to allocate the memory) and Windows (the HDC is owned by PlatformBitmap, the HBITMAP by the SkPixelRef). CopyFromBackingStore: instead of requiring the caller to provide a PlatformBitmap, modify the signature so that the completion callback accepts an SkBitmap. Sometimes, the backing store copiers will allocate a PlatformBitmap and pass its SkBitmap to the completion callback, but this becomes merely an implementation detail. Meanwhile, in the accelerated case, it is not at all necessary to allocate a PlatformBitmap, so don't. This fixes a bug on Linux where the cairo surface context was being freed on a thread other than the UI thread. PlatformBitmap is basically not thread safe on Linux, and this change fixes that. Also fixed is a Dr. Memory GDI usage warning -- we are sure to de-select the HBITMAP before deleting the memory DC. Lastly, moving CopyFromBackingStore's interface to use a callee-managed SkBitmap conditions the architecture for doing RGBA->YUV on the GPU, prior to readback. BUG=109963,159234,161537 Review URL: https://codereview.chromium.org/12087016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180271 0039d316-1c4b-4281-b951-d872f2087c98
* Switch do GDI rendering when the screensaver is active.vangelis@chromium.org2013-01-311-0/+9
| | | | | | | | | | | | | | | | | | | | | | | When the screen saver or login-screen are active, any calls we make to d3d present get ignored. As a result, after coming back, the browser displays stale contents until the page refreshes again. This is only a problem if AERO (the Windows compositor) is turned on. With AERO on, our window doesn't seem to be getting any useful notifications when we enter or exit the screensaver that we could use to trigger a repaint. With AERO off we get a WM_PAINT which forces us to repaint. If we use the GDI display path (which requires an expensive texture readback and a blit) the contents of the window update correctly. The unfortunate side-effect of this change is that while in screen saver mode our CPU utilization for pages that update often (e.g. have an active CSS animation) will significantly increase. BUG=133121 Review URL: https://chromiumcodereview.appspot.com/11863013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179808 0039d316-1c4b-4281-b951-d872f2087c98
* Speculative fix for the white/stale tab issue on Windows.vangelis@chromium.org2013-01-251-0/+4
| | | | | | | | | | | | | | | | | Adds two flags to trigger a Present via GDI the first time Present is called after the tab had been hidden: --all-show-present-with-GDI : GDI present on every first present after tab is unhidden --first-show-present-with-GDI : GDI present only once, the very first time the tab is unhidden. (pushing these through. trybot failures are unrelated since this CL just adds a flag that's disabled by default) BUG=169848 NOTRY=true Review URL: https://chromiumcodereview.appspot.com/12039052 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178729 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 174920jamesr@chromium.org2013-01-071-8/+5
| | | | | | | | | | | | | | | | | | | | > Reland 174257 with fix for win_aura > > win: AcceleratedPresenter replies to the GPU process as soon as shared texture is copied. > > This means the GPU does not deschedule for as long waiting until it can render to the back buffer safely. > > TBR=apatrick@chromium.org > > Review URL: https://chromiumcodereview.appspot.com/11642051 Reverting to isolate performance regression on gpu_frame_rate tests on windows TBR=apatrick@chromium.org BUG=168470 Review URL: https://codereview.chromium.org/11782018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175379 0039d316-1c4b-4281-b951-d872f2087c98
* Reland 174257 with fix for win_auraapatrick@chromium.org2013-01-031-5/+8
| | | | | | | | | | | | win: AcceleratedPresenter replies to the GPU process as soon as shared texture is copied. This means the GPU does not deschedule for as long waiting until it can render to the back buffer safely. TBR=apatrick@chromium.org Review URL: https://chromiumcodereview.appspot.com/11642051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174920 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "win: AcceleratedPresenter replies to the GPU process as soon as ↵phajdan.jr@chromium.org2012-12-201-8/+5
| | | | | | | | | | | | | | shared texture is copied." This reverts commit ad526010baec7a1cb70b94ae0ef6c06f967007db. TBR=apatrick BUG= Review URL: https://codereview.chromium.org/11571091 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174260 0039d316-1c4b-4281-b951-d872f2087c98
* win: AcceleratedPresenter replies to the GPU process as soon as shared ↵apatrick@chromium.org2012-12-201-5/+8
| | | | | | | | | | texture is copied. This means the GPU does not deschedule for as long waiting until it can render to the back buffer safely. Review URL: https://chromiumcodereview.appspot.com/11645027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174257 0039d316-1c4b-4281-b951-d872f2087c98
* Move readback to present thread.nick@chromium.org2012-11-171-6/+18
| | | | | | | | | | | | Eliminates blocking of main thread when readback is happening every frame, as can happen when tab capture is enabled. BUG=145587 TEST=Run chrome with tab capture extension enabled, verify using about:tracing that main thread doesn't have long blocks waiting on the present mutex. Review URL: https://chromiumcodereview.appspot.com/11410043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168433 0039d316-1c4b-4281-b951-d872f2087c98
* Windows: AcceleratedSurface presents with GDI while the window is being resized.apatrick@chromium.org2012-10-041-4/+19
| | | | | | | | | | 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
* Listen in the browser for a connection from a metro viewer process.scottmg@google.com2012-10-011-0/+6
| | | | | | | | | | Render to the surface it provides to us. BUG=151718 Review URL: https://codereview.chromium.org/10984007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159559 0039d316-1c4b-4281-b951-d872f2087c98
* Windows: AcceleratedSurface present thread periodically polls raster status.apatrick@chromium.org2012-09-211-13/+2
| | | | | | | | | | | | | | This is to give the threaded compositor a recent time base to work with. Also use acknowledge with the surrent refresh period for the swap chain. Moved call to Present to before the spin on the Query since that is unnecessary and allows earlier acknowledgement. BUG=143854 Review URL: https://chromiumcodereview.appspot.com/10892018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157920 0039d316-1c4b-4281-b951-d872f2087c98
* Enable GPU acceleration for Aura on Windowsscottmg@chromium.org2012-09-061-4/+4
| | | | | | | | | | | | | | | Use GpuTransportSurface and AcceleratedSurface for rendering on win aura. Run with: --open-ash --force-compositing-mode --enable-threaded-compositing BUG= Review URL: https://chromiumcodereview.appspot.com/10890046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155093 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 152664 - win: Always present AcceleratedSurface via the UI thread.apatrick@chromium.org2012-08-221-5/+1
| | | | | | | | | | | | | | | | | | | Presenting from a present thread causes flickering issues when Aero is turned on. Synchronization between the CPU and GPU still happens on the present thread because moving everything tot the UI thread caused jank on resizing. The UI thread polls until DWM returns that there are no pending presents so that when it calls Present it won't block. This did not work as well with Aero turned off so I used the original method of presenting on the present thread in that case. BUG=120904 Review URL: https://chromiumcodereview.appspot.com/10823133 TBR=apatrick@chromium.org Review URL: https://chromiumcodereview.appspot.com/10870017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152804 0039d316-1c4b-4281-b951-d872f2087c98
* win: Always present AcceleratedSurface via the UI thread.apatrick@chromium.org2012-08-211-1/+5
| | | | | | | | | | | | | | | | Presenting from a present thread causes flickering issues when Aero is turned on. Synchronization between the CPU and GPU still happens on the present thread because moving everything tot the UI thread caused jank on resizing. The UI thread polls until DWM returns that there are no pending presents so that when it calls Present it won't block. This did not work as well with Aero turned off so I used the original method of presenting on the present thread in that case. BUG=120904 Review URL: https://chromiumcodereview.appspot.com/10823133 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152664 0039d316-1c4b-4281-b951-d872f2087c98
* Plumb vsync info from AcceleratedPresenter to RenderWidgetHostImpljbates@chromium.org2012-08-141-4/+7
| | | | | | | | | BUG=137792 Review URL: https://chromiumcodereview.appspot.com/10820041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151514 0039d316-1c4b-4281-b951-d872f2087c98
* Use DwmGetCompositionTimingInfo to get vsync info on Windowsbrianderson@chromium.org2012-08-071-0/+12
| | | | | | | | | BUG= Review URL: https://chromiumcodereview.appspot.com/10825053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150395 0039d316-1c4b-4281-b951-d872f2087c98
* Support copying a partial rectangle region from the compositing surface on Win.mazda@chromium.org2012-07-281-5/+14
| | | | | | | | | | BUG=118571 TEST=Manual Review URL: https://chromiumcodereview.appspot.com/10829054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148889 0039d316-1c4b-4281-b951-d872f2087c98
* Always reverse rows prior to presenting in AcceleratedSurface on Windows.apatrick@chromium.org2012-07-241-3/+0
| | | | | | | | We aren't using it any the non-reversed path for anything now. Review URL: https://chromiumcodereview.appspot.com/10804028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148197 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the rest of #pragma once in one big CL.ajwong@chromium.org2012-07-111-1/+0
| | | | | | | | | For context see this thread: https://groups.google.com/a/chromium.org/forum/?fromgroups#!topic/chromium-dev/RMcVNGjB4II TBR=thakis,pkasting,jam git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146163 0039d316-1c4b-4281-b951-d872f2087c98
* Windows: added command line switch to reverse rows of image transport surface.apatrick@chromium.org2012-06-151-0/+3
| | | | | | | | This is because in a branch of ANGLE, pbuffer rows are reversed and this compensates. Review URL: https://chromiumcodereview.appspot.com/9915001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142452 0039d316-1c4b-4281-b951-d872f2087c98
* Windows: Do not fast tab switch if the tab has resized.apatrick@chromium.org2012-06-151-6/+20
| | | | | | | | | | | | This looks bad visually because when the tab is initially selected, one frame of the page rendered at a different size is presented. Also, got rid of the compositor host window on Vista and later. Still needed for XP unfortunately. BUG=131736 Review URL: https://chromiumcodereview.appspot.com/10540136 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142331 0039d316-1c4b-4281-b951-d872f2087c98
* ui: Move surface/ directory out of gfx/, up to ui/.tfarina@chromium.org2012-05-031-0/+124
BUG=104040 R=ben@chromium.org TBR=brettw@chromium.org Review URL: https://chromiumcodereview.appspot.com/10351002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@135232 0039d316-1c4b-4281-b951-d872f2087c98