summaryrefslogtreecommitdiffstats
path: root/cc/output/output_surface.cc
Commit message (Collapse)AuthorAgeFilesLines
* Tiling priorities in Android Webview.hush@chromium.org2014-07-311-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | Use the parent compositor's clip and transform for tile priorities in child compositor. When the transform matrix changes in parent compositor (hardware_renderer.cc), it posts the matrix and the clip to the child compositor. (The parent clip is in screen space and the parent matrix transforms from webview space to screen space) Child compositor will use them for tile prioritization. In child compositor during updating tile priority, the clip from parent is transformed from screen space to view space, then from view space to content space. Then the result rect will intersect with content_bounds() and the intersection is used as tile priority input. BUG=372073 Review URL: https://codereview.chromium.org/394113002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286731 0039d316-1c4b-4281-b951-d872f2087c98
* cc/output: cleanup: Remove unnecessary #includesheejin.r.chung@samsung.com2014-07-271-4/+2
| | | | | | | | | | Remove or move/change #includes to appropriate places/ones. BUG= Review URL: https://codereview.chromium.org/416273005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285835 0039d316-1c4b-4281-b951-d872f2087c98
* Pass resourceless software mode in SetExternalConstraintsboliu@chromium.org2014-07-101-7/+6
| | | | | | | | | | | | | | | | This fixes the bug that resourceless software mode not dirtying the draw properties. This allows OutputSurface::ForcedDrawToSoftwareDevice to be removed. And merged the valid_for_tile_management parameter into resourceless_software_draw. This effectively reverses the last bool parameter on SetExternalDrawConstraints. BUG=391829 Review URL: https://codereview.chromium.org/376683004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282445 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Remove disabled LatencyQuery logic in OutputSurfacebrianderson@chromium.org2014-07-091-100/+3
| | | | | | | | | | | We can add this back when we figure out why it was causing flickering on some devices. BUG=317928 Review URL: https://codereview.chromium.org/323423005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281915 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Allow DeferredInitialize to use DelegatingRendererboliu@chromium.org2014-05-221-1/+7
| | | | | | | | | | | | | | | | | | | | | | | Currently DeferredInitialize assumes OutputSurface never has delegated_rendering capability. With this change, remove this assumption by always first creating SoftwareRenderer for OutputSurface with deferred_gl_initialization. Then create either DelegatingRenderer or GLRenderer depending on delegated_rendering capability in DeferredInitialize. With support for DelegatingRenderer and DeferredInititalize, have to ensure that all GL resources are returned to child before ReleasGL is called, because ContextProvider is going away after ReleaseGL. Add a DCHECK for this in ResourceProvider::CleanUpGLIfNeeded. New path covered by LayerTreeHostTestDeferredInitialize. BUG=344087 Review URL: https://codereview.chromium.org/286953008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272070 0039d316-1c4b-4281-b951-d872f2087c98
* Make delegated software renderer work on Macccameron@chromium.org2014-05-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Add a device scale factor parameter to SoftwareOutputDevice::Resize and plumb that parameter through to the contentsScale property of the CALayer that is used to draw the software frame. Change the way that RWHVMac draws software frames (both delegated and non-delegated) so that the CALayer for the software frame has setContents called on it with a CGImageRef of the software frame, instead of drawing the CGImageRef to the inside the CALayer's displayInContext function. This is the way that things should have been done to begin with (it involves a lot less copying and a lot more idle time in the browser main thread), but wasn't compatible with the (now-defunct) legacy software path. Change the software rendering path to set the contentsScale of the software CALayer at the time that the software frame is received, when the contents are updated, instead of in RWHVMac::LayoutLayers. BUG=314190 Review URL: https://codereview.chromium.org/297573003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271839 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Move scheduling logic out of OutputSurfacebrianderson@chromium.org2014-04-261-137/+20
| | | | | | | | | | | | | | | | | This moves the vsync throttling enabled/disabled logic and the synthetic/emulated BeginFrame logic out of OutputSurface and moves it to the Scheduler. This then allows us to also remove the retroactive BeginFrame logic from OutputSurface since the Scheduler also has retroactive BeginFrame logic. BUG=246861 BUG=251909 Review URL: https://codereview.chromium.org/221833009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266348 0039d316-1c4b-4281-b951-d872f2087c98
* Remove offscreen compositor contexts.danakj@chromium.org2014-04-241-4/+3
| | | | | | | | | | | | | | | After https://codereview.chromium.org/250083002/ cc no longer uses an offscreen context for ganesh filters. Instead using the main onscreen context. So, delete the code to create offscreen contexts for the compositor. R=abarth@chromium.org, boliu@chromium.org, enne@chromium.org, piman@chromium.org, enne, piman BUG=366132,366130 Review URL: https://codereview.chromium.org/251343002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@265974 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Throttle swaps in Scheduler instead of OutputSurfacebrianderson@chromium.org2014-04-181-58/+38
| | | | | | | | | | | | This doesn't represent a functional change and only moves the swap throttling logic from the OutputSurface to the Scheduler. BUG=311213 Review URL: https://codereview.chromium.org/199523002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264732 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Handle retroactive BeginFrames in the Scheduler.brianderson@chromium.org2014-04-121-51/+52
| | | | | | | | | | | | | | | | | | | | | | | This will be the first step allowing us to pull logic out of the OutputSurface. Initially, the retroactive logic will exist in both the OutputSurface and the scheduler. Then, as all logic that depends on the retroactive logic has moved to the scheduler, I will remove the retroactive logic in OutputSurface. There are now 4 BeginFrames in the scheduler: 1) BeginFrame: from the OutputSurface. 2) BeginRetroFrame: a deferred BeginFrame. 3) BeginImplFrame: starts a compositor frame. 4) BeginMainFrame: starts a main frame. BUG=358409 Review URL: https://codereview.chromium.org/218633010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263435 0039d316-1c4b-4281-b951-d872f2087c98
* Fix "unreachable code" warnings (MSVC warning 4702), misc. edition.pkasting@chromium.org2014-03-181-2/+3
| | | | | | | | | | | | This CL covers top-level directories that only had one or two modified files. BUG=346399 TEST=none R=darin@chromium.org Review URL: https://codereview.chromium.org/203043002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257705 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 250798 "Revert of Read compositor VSync information from ..."sergeyu@chromium.org2014-02-121-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Broke compilation. > Revert of Read compositor VSync information from platform, when possible (https://chromiumcodereview.appspot.com/138903025/) > > Reason for revert: > Reverting due to Windows crashes. See: > > http://crbug.com/343199 > > Original issue's description: > > Read compositor VSync information from platform, when possible > > > > The current query of VSync information through the GL context can be unreliable > > on platforms that can dynamically disable vblanks, or multi-monitor setups. > > Preferentially query the VSync information through the platform windowing > > system (presently: XRandR on CrOS) when possible. > > > > BUG=328953 > > TEST=local build, run on CrOS snow > > > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=250250 > > TBR=oshima@chromium.org,piman@chromium.org,brianderson@chromium.org,sky@chromium.org,mukai@chromium.org > NOTREECHECKS=true > NOTRY=true > BUG=328953 > > Review URL: https://codereview.chromium.org/161413002 TBR=sheu@chromium.org Review URL: https://codereview.chromium.org/161743002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@250810 0039d316-1c4b-4281-b951-d872f2087c98
* Revert of Read compositor VSync information from platform, when possible ↵sheu@chromium.org2014-02-121-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (https://chromiumcodereview.appspot.com/138903025/) Reason for revert: Reverting due to Windows crashes. See: http://crbug.com/343199 Original issue's description: > Read compositor VSync information from platform, when possible > > The current query of VSync information through the GL context can be unreliable > on platforms that can dynamically disable vblanks, or multi-monitor setups. > Preferentially query the VSync information through the platform windowing > system (presently: XRandR on CrOS) when possible. > > BUG=328953 > TEST=local build, run on CrOS snow > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=250250 TBR=oshima@chromium.org,piman@chromium.org,brianderson@chromium.org,sky@chromium.org,mukai@chromium.org NOTREECHECKS=true NOTRY=true BUG=328953 Review URL: https://codereview.chromium.org/161413002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@250798 0039d316-1c4b-4281-b951-d872f2087c98
* Read compositor VSync information from platform, when possiblesheu@chromium.org2014-02-111-5/+8
| | | | | | | | | | | | | | The current query of VSync information through the GL context can be unreliable on platforms that can dynamically disable vblanks, or multi-monitor setups. Preferentially query the VSync information through the platform windowing system (presently: XRandR on CrOS) when possible. BUG=328953 TEST=local build, run on CrOS snow Review URL: https://codereview.chromium.org/138903025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@250250 0039d316-1c4b-4281-b951-d872f2087c98
* [#7] Pass gfx::Size by const ref.prashant.n@samsung.com2014-01-291-1/+1
| | | | | | | | | | | | | | | Any struct of size > 4 bytes should be passed by const ref. Passing by ref for these structs is faster than passing by value, especially when invoking function has multiple parameters and some other scenarios mentioned in the bug. BUG=159273 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=247426 Review URL: https://codereview.chromium.org/145313006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247769 0039d316-1c4b-4281-b951-d872f2087c98
* Revert of [#7] Pass gfx structs by const ref (gfx::Size) ↵mnissler@chromium.org2014-01-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/145313006/) Reason for revert: Suspected of breaking the Linux ASAN tests ( http://build.chromium.org/p/chromium.memory/builders/Linux%20ASAN%20Tests%20%283%29/builds/22104 ) Original issue's description: > [#7] Pass gfx::Size by const ref. > > Any struct of size > 4 bytes should be passed by const ref. > Passing by ref for these structs is faster than passing by value, > especially when invoking function has multiple parameters and some > other scenarios mentioned in the bug. > > BUG=159273 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=247426 TBR=danakj@chromium.org,enne@chromium.org,bulach@chromium.org,piman@chromium.org,prashant.n@samsung.com NOTREECHECKS=true NOTRY=true BUG=159273 Review URL: https://codereview.chromium.org/142863008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247437 0039d316-1c4b-4281-b951-d872f2087c98
* [#7] Pass gfx::Size by const ref.prashant.n@samsung.com2014-01-281-1/+1
| | | | | | | | | | | | | Any struct of size > 4 bytes should be passed by const ref. Passing by ref for these structs is faster than passing by value, especially when invoking function has multiple parameters and some other scenarios mentioned in the bug. BUG=159273 Review URL: https://codereview.chromium.org/145313006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247426 0039d316-1c4b-4281-b951-d872f2087c98
* Pass gfx::Rect and gfx::RectF by const ref.prashant.n@samsung.com2014-01-101-3/+3
| | | | | | | | | | | | | | | | | Avoid unneccessary copy of structures gfx::Rect & gfx::RectF by passing them by const ref rather than value. Any struct of size > 4 bytes should be passed by const ref. Passing by ref for these structs is faster than passing by value, especially when invoking function has multiple parameters. Pass by value creates unneccessary overhead which should be avoided. BUG=159273 Review URL: https://codereview.chromium.org/93663004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244224 0039d316-1c4b-4281-b951-d872f2087c98
* Use the GL in process bindings directly in cc_unittestsjamesr@chromium.org2013-12-201-10/+9
| | | | | | | | | | | This binds cc_unittests to the GL in process command buffer bindings directly instead of relying on the setup in webkit/common/gpu. BUG=181120 Review URL: https://codereview.chromium.org/105303003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242005 0039d316-1c4b-4281-b951-d872f2087c98
* Implicitly ensure backbuffer creation on drawjamesr@chromium.org2013-12-131-2/+0
| | | | | | | | | | | | Instead of having a special IPC channel to ensure a backbuffer is allocated for a given GL context, we can create it implicitly on the first draw attempt into FBO 0. If this fails, the context is considered lost. BUG=181120 Review URL: https://codereview.chromium.org/112303002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240797 0039d316-1c4b-4281-b951-d872f2087c98
* Add GL entry points for DiscardBackbufferCHROMIUMjamesr@chromium.org2013-12-131-1/+2
| | | | | | | | | | | | This adds and uses a GL command buffer command for DiscardBackbufferCHROMIUM instead of having a WebGraphicsContext3D entry point + common/ IPC message. This is used to deallocate, if possible, the backbuffer when no longer in use. BUG=181120 Review URL: https://codereview.chromium.org/104823005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240583 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Add PRESUBMIT rule to ban using cc:: inside of namespace cc {...}danakj@chromium.org2013-12-101-7/+5
| | | | | | | | | | | | | | | | | | | This also makes cc/ PRESUBMIT clean for the new check. The most invasive changes were: 1. Moving the cc/test/paths.h enum into a CCPaths class (named with CC prefix to clarify this path is for CC since the enum is extending an enum from base/. 2. Merge ResourcePool::Resource up into ScopedResource which was the same thing basically. R=enne BUG= Review URL: https://codereview.chromium.org/109263003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239904 0039d316-1c4b-4281-b951-d872f2087c98
* Pipe SwapBuffers call{,backs} through ContextSupportjamesr@chromium.org2013-12-101-24/+9
| | | | | | | | | | | | | | | | | | This plumbs the SwapBuffers calls and callbacks through the gpu::ContextSupport interface instead of WGC3D. There are two production paths for the callbacks - using Echo and using View IPCs. The former is used everywhere except for single-threaded mac and guest plugin mode. This implements the Echo path directly in GLES2Implementation and leaves the implementation of the non-Echo path in WGC3DCommandBufferImpl. We'll still have to clean that up to avoid having to allocate a WGC3D, but this at least gets rid of the API dependencies from cc. R=piman BUG=181120 Review URL: https://codereview.chromium.org/59233007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239685 0039d316-1c4b-4281-b951-d872f2087c98
* Remove always-on compositor capabilitiesjamesr@chromium.org2013-12-061-6/+2
| | | | | | | | | | | | | | | | | | | All context implementations the compositor uses support the following capabilities: - discard_backbuffer - set_visibility - map_sub - shallow_flush so there's no point in passing these values or, even worse, branching on them. R=piman Review URL: https://codereview.chromium.org/94113004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239171 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 234928 "Use software compositor for windows under 64 pixe..."jbauman@chromium.org2013-11-151-9/+3
| | | | | | | | | | | | | | | | | | | | This broke extension popups. > Use software compositor for windows under 64 pixels wide or tall. > > They're broken on AMD drivers. Switch back and forth between software and hardware using lost device on the output surface on resize. > > BUG=286609 > R=jamesr@chromium.org > > Review URL: https://codereview.chromium.org/61323003 TBR=jbauman@chromium.org BUG=286609,319644,312277 Review URL: https://codereview.chromium.org/73723004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235409 0039d316-1c4b-4281-b951-d872f2087c98
* Use software compositor for windows under 64 pixels wide or tall.jbauman@chromium.org2013-11-131-3/+9
| | | | | | | | | | | They're broken on AMD drivers. Switch back and forth between software and hardware using lost device on the output surface on resize. BUG=286609 R=jamesr@chromium.org Review URL: https://codereview.chromium.org/61323003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234928 0039d316-1c4b-4281-b951-d872f2087c98
* CC: Remove latency query until we can find the bug.epenner@chromium.org2013-11-081-0/+2
| | | | | | | | | | | | | | | The addition of latency queries causes black flickering on Galaxy Note 3. Chrome queries shouldn't even change the GL stream, so there must a bug somewhere and this could be affecting all platforms. Minimal disable until we find the bug. BUG=306690 Review URL: https://codereview.chromium.org/29313004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233824 0039d316-1c4b-4281-b951-d872f2087c98
* Replaces uses of the WGC3DSwapBuffersClient with LTHSingleThreadClientjamesr@chromium.org2013-11-081-0/+1
| | | | | | | | | | | | | | | | | This converts users of the WebGraphicsContext3DSwapBuffersClient mechanism over to using callbacks from cc::LayerTreeHostSingleThreadClient instead. This mechanism is a way to implement flow control when using single threaded compositing by keeping track of the number of pending SwapBuffers calls. WGC3DSwapBuffersClient hooked into the context directly to observer these calls, but intercepted the calls at an awkward place. This instead gets callbacks directly from the compositor when using the single threaded path. R=piman BUG=181120 Review URL: https://codereview.chromium.org/59033012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233777 0039d316-1c4b-4281-b951-d872f2087c98
* Clean up GPU latency queries when the context is resetajuma@chromium.org2013-11-081-0/+10
| | | | | | | | | | | | This explicitly deletes queries when the context is reset (e.g. when the OutputSurface is destroyed). Failing to destroy the queries may be causing flickering on some devices. BUG=306690,243459 Review URL: https://codereview.chromium.org/32723003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233718 0039d316-1c4b-4281-b951-d872f2087c98
* Do not give GPU memory to backgrounded compositors.ccameron@chromium.org2013-11-011-6/+3
| | | | | | | | | | | | | | | | | | | | This has already been disabled on all platforms except Windows and Chrome OS to be more conservative about GPU memory. All platforms are moving to a delegated renderer where, if keeping around resources for a fast tab-switch is desired, it can be accomplished by not releasing those resources in the browser process. This feature was originally requested in crbug.com/134750. Also remove the infrastructure for preserving backbuffers of backgrounded renderers. This feature was never enabled. BUG=276559 Review URL: https://codereview.chromium.org/53633003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232324 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Use HighResNow as timebase if it is fast and reliablebrianderson@chromium.org2013-10-251-4/+8
| | | | | | | | | | | | | | | | | | | If base::TimeTicks::HighResNow is fast and reliable, we use it for frame times, animations, and scheduling. Otherwise, we use base::TimeTicks::Now and use a timebase of zero to avoid an incorrect or jittery timebase. This adds a gfx::FrameTime::Now() function, so the same timebase is used across the ui and cc directories. Additionally, the OutputSurface now uses a HighRes version of the DelayBasedTimesource if gfx::FrameTime::Now() is HighRes. BUG=303356 Review URL: https://codereview.chromium.org/27710005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231089 0039d316-1c4b-4281-b951-d872f2087c98
* Rename BeginFrame to BeginMainFrame and BeginImplFrame (part 3).dominikg@chromium.org2013-10-231-46/+48
| | | | | | | | | | | | | | | | | Third patch in a series to rename BeginFrame. This patch focuses on cc::ThreadProxy, cc::LayerTreeHost, cc::LayerTreeHostImpl, cc::OutputSurface and it's related (sub)classes. In the scheduler, the term 'BeginFrame' is used for both the main thread and the impl thread. This can cause confusion if it's not obvious which one is being refered to. To clarify this, we rename BeginFrame to BeginMainFrame and BeginImplFrame, respectively. BUG=261765 Review URL: https://codereview.chromium.org/35023002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@230453 0039d316-1c4b-4281-b951-d872f2087c98
* Add UMA stats for GPU latency and GPU latency estimationajuma@chromium.org2013-10-171-1/+27
| | | | | | | | | | | This adds UMA stats measuring GPU latency and the amount by which this latency is underestimated or overestimated each frame. BUG=243459 Review URL: https://codereview.chromium.org/27043011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@229109 0039d316-1c4b-4281-b951-d872f2087c98
* Estimate GPU latency in OutputSurfaceajuma@chromium.org2013-10-101-3/+62
| | | | | | | | | | | | This adds a GpuLatencyEstimate method to OutputSurface. The estimate is computed based on recent GPU latency, found using LatencyQueries (GL_LATENCY_QUERY_CHROMIUM). BUG=243459 Review URL: https://codereview.chromium.org/17631003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228030 0039d316-1c4b-4281-b951-d872f2087c98
* CC: WeakPtrFactory should be the last member.dmichael@chromium.org2013-10-081-6/+6
| | | | | | | | BUG=303818 Review URL: https://codereview.chromium.org/26228003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227578 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Implement deadline scheduling disabled by defaultbrianderson@chromium.org2013-09-211-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds logic to the Scheduler to actually use the BeginFrame and deadline, but is not enabled by default on any platform yet. This will ensure emulation of old scheduler in the fallback path is sane. Emulation of the old path is implemented using an immediate deadline. SchedulerStateMachine::begin_frame_state has been added and can be in one of 4 states: Idle, InsideBeginFrame, DeadlinePending, or InsideDeadline. Notable restrictions of the states are: - We start a commit as soon after InsideBeginFrame as we can, since the BeginFrame will be coordinated with user input. (True on Android. Soon to be true on other platforms.) - We do not start a commit while Idle, in order to wait for the next batch of user input. - Draw and swap only occurs during the InsideDeadline state. The deadlines of the Browser and Renderer compositors can be nested in order to have a total draw latency of < 1 frame when starting off. If we can't hit 1 frame of latency consistently, we will fall back to a higher latency mode to increase throughput. TBR=enne@chromium.org BUG=243461 Review URL: https://chromiumcodereview.appspot.com/24070006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@224560 0039d316-1c4b-4281-b951-d872f2087c98
* Add memory manager for software compositor frontbuffers.jbauman@chromium.org2013-09-181-10/+12
| | | | | | | | | | A limited number of frontbuffers for the software compositor should be kept around, and the rest should be returned to the renderers to be destroyed. BUG=158487 Review URL: https://chromiumcodereview.appspot.com/23875007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223831 0039d316-1c4b-4281-b951-d872f2087c98
* Connect OutputSurface buffer management and document SoftwareOutputDevicerjkroege@chromium.org2013-09-141-0/+4
| | | | | | | | | | | Add explanatory comments to the SoftwareOutputDevice API and connect it up to OutputSurface. BUG=none Review URL: https://chromiumcodereview.appspot.com/23691060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223222 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Always use SetNeedsBeginFrame to request the next BeginFramebrianderson@chromium.org2013-09-141-9/+8
| | | | | | | | | | | | | | | | This avoids relying on SwapBuffers to implicitly trigger the next BeginFrame. Only a single code path is used to request the next BeginFrame now: SetNeedsBeginFrame(true). This avoids issues where OutputSurface subclasses might not call OutputSurface::DidSwap() when they need to or when we early out a swap request and don't actually swap anything. BUG=289755 Review URL: https://chromiumcodereview.appspot.com/23498035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223218 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Remove most methods from RendererClient.danakj@chromium.org2013-09-091-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | This class is being used to pass data to the Renderer, but it's more clear if we just pass the data directly when we call DrawFrame. There are also some interesting round trips where OutputSurface sets data on the OutputSurfaceClient (LayerTreeHostImpl) which just stores the data. Then the data is accessed through the RendererClient or on the LTHI directly, but in places that could just query it from the OutputSurface directly. This patch unravels one of these loops with HasExternalStencilTest(). The remaining two getters on RendererClient are called in both DrawFrame and in SwapBuffers, so I'm not sure if we want to pass them directly to both functions (redundency is error-prone) or we have some other nice idea to get rid of them. R=enne BUG= Review URL: https://chromiumcodereview.appspot.com/23961003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222050 0039d316-1c4b-4281-b951-d872f2087c98
* Fix UpdateTilePriorities viewport in Android WebView.aelias@chromium.org2013-09-051-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the tile management viewport to be the on-screen-visible rect for the last hardware draw. There are two problems I needed to solve: 1) Suppress UpdateTilePriorities from happening when the last draw was a software draw, which is specified by the new "viewport_valid_for_tile_management" bool. 2) In some cases, the clip rect is smaller than the WebView's visible viewport -- for example when the Android Browser progress bar is forcing redraws, the clip is only a small area at the top of the screen. I switched to using the visible viewport for UpdateDrawProperties + glViewport, and introduce a separate "DeviceClip" to override glScissor. (It's necessary to make the change at this level, rather than directly plumbing the visible viewport to UpdateTilePriorities, because UpdateTilePriorities also makes use of outputs from the draw properties calculation.) I also cleaned up all uses of device_viewport_size() to call DrawViewportSize() instead, with the sole exception of UnscaledScrollableViewportSize() which should continue to use the main-thread device_viewport_size_ in all cases (because that's the viewport for scrolling, not drawing). New tests: PictureLayerImplTest.SuppressUpdateTilePriorities, ExternalStencilPixelTest.DeviceClip NOTRY=true BUG=232844 Review URL: https://chromiumcodereview.appspot.com/23171014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221321 0039d316-1c4b-4281-b951-d872f2087c98
* Pass context capabilities via cc::ContextProvider instead of gl stringjamesr@chromium.org2013-08-291-11/+5
| | | | | | | | | | | | | | | | | | | This migrates cc to checking for context capabilities through a struct provided by the ContextProvider instead of parsing out the GL_EXTENSIONS string manually. This is a very minor performance win, since we don't parse the string multiple times. More importantly, this centralizes capability testing into one place and breaks cc's dependency on WebString. The implementation of ContextCapabilities() in content still parses out the extensions string from the context, but we can route this data in more directly in a follow-up. BUG=279518 Review URL: https://chromiumcodereview.appspot.com/23466003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@220186 0039d316-1c4b-4281-b951-d872f2087c98
* Discard software renderer backbuffer when tab becomes invisible.jbauman@chromium.org2013-08-201-4/+2
| | | | | | | | | | We should delete the backbuffers to save memory. BUG=158487 Review URL: https://chromiumcodereview.appspot.com/22801004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@218543 0039d316-1c4b-4281-b951-d872f2087c98
* ContextProvider in OutputSurfacedanakj@chromium.org2013-08-161-110/+61
| | | | | | | | | | | | | | | | Instead of putting a raw WebGraphicsContext3D in the OutputSurface given to the compositor, put a ContextProvider. This requires embedders to create ContextProviders instead of raw contexts. No change in behaviour. Covered by existing tests, including cc/ context loss tests. BUG=258625 R=aelias@chromium.org, jamesr@chromium.org, piman@chromium.org, sievers@chromium.org Review URL: https://codereview.chromium.org/20185002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@217890 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Avoid double ticking RetroactiveBeginFramesbrianderson@chromium.org2013-08-151-2/+4
| | | | | | | | | | | | | | | | This avoids executing a retroactive BeginFrame if it's frame time is within the double tick threshold. This only affects platforms that use BeginFrame emulation, which is currently all platforms except for Android. BUG=270287 Review URL: https://chromiumcodereview.appspot.com/22474011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@217725 0039d316-1c4b-4281-b951-d872f2087c98
* Add memory policy limit by number of resources.aelias@chromium.org2013-08-031-5/+12
| | | | | | | | | | | | | | | | | | | | Currently, MemoryPolicy only limits by number of bytes allocated. For resources like Android gralloc buffers which also have a process or system-wide limit, we also need to limit by count of the resource. This patch implements this and sets a limit of 100 from the AndroidWebView OutputSurface. As additional cleanup, I also moved the ignore-0-memory-policy logic to OutputSurface as it doesn't seem appropriate in CC. New test parametrization for TileManagerTests. NOTRY=true BUG=266619 Review URL: https://chromiumcodereview.appspot.com/20843007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215464 0039d316-1c4b-4281-b951-d872f2087c98
* Add external stencil support for Android WebView.aelias@chromium.org2013-07-301-0/+4
| | | | | | | | | | | | | | | | | | For non-rectangular clips, the Android framework populates the stencil buffer before asking WebView to draw. This adds support for CC to use an externally provided stencil buffer instead of always disabling stencil test. This change is the final piece needed to make rotation transforms work correctly. New tests ExternalStencilPixelTest.* NOTRY=true BUG=264053 R=danakj@chromium.org, joth@chromium.org, tedchoc@chromium.org Review URL: https://codereview.chromium.org/20579004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214416 0039d316-1c4b-4281-b951-d872f2087c98
* Use a direct include of the message_loop header in cc/, chrome_frame/, ↵avi@chromium.org2013-07-171-1/+1
| | | | | | | | | | | | cloud_print/, components. BUG=260807 TEST=none TBR=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/19403002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212143 0039d316-1c4b-4281-b951-d872f2087c98
* OutputSurfaceClient::ReleaseGLboliu@chromium.org2013-07-131-4/+14
| | | | | | | | | | | | | For Android WebView, when the webview is detached from the view tree, it is the last chance we have of releasing all GL resources. This is essentially the reverse of DeferredInitialize, synchronously releasing GL resources and reverting back to software mode and zero-budget. BUG=256276 Review URL: https://chromiumcodereview.appspot.com/18279003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211523 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Add missing includes of WebGraphicsMemoryAllocation.htfarina@chromium.org2013-07-111-0/+1
| | | | | | | | | | | | | | The declaration of WebGraphicsMemoryAllocation type is been used through the include of WebGraphicsContext3D.h, but for iwyu is better to explicity include it. BUG=None TEST=cc_unittests R=danakj@chromium.org Review URL: https://codereview.chromium.org/18941004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211111 0039d316-1c4b-4281-b951-d872f2087c98