summaryrefslogtreecommitdiffstats
path: root/cc
Commit message (Collapse)AuthorAgeFilesLines
* cc: Make RenderPass into a struct-like class.danakj@chromium.org2012-11-2121-554/+679
| | | | | | | | | | | | | | | | | | | This follows the same pattern as DrawQuad and SharedQuadState. The Create() method takes no parameters, allowing the IPC code to create an empty RenderPass. Then we have SetNew() and SetAll() methods to set the the properties of the RenderPass when creating a new one, or when recreating one via IPC, respectively. Covered by existing tests. BUG=152337 TBR=aelias Review URL: https://chromiumcodereview.appspot.com/11413106 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168998 0039d316-1c4b-4281-b951-d872f2087c98
* [base] Move AutoReset to base namespace.dbeam@chromium.org2012-11-211-1/+1
| | | | | | | | | | | NOTRY=true R=darin@chromium.org BUG=None Review URL: https://chromiumcodereview.appspot.com/11308132 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168978 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Don't return non-const Layer* from a const Layer.danakj@chromium.org2012-11-217-23/+38
| | | | | | | | | | | | Const methods should return const Layer*s. Non-const methods return non-const Layer*s. R=enne Review URL: https://chromiumcodereview.appspot.com/11299127 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168973 0039d316-1c4b-4281-b951-d872f2087c98
* YUV software decode path stride fixes.sheu@chromium.org2012-11-213-29/+175
| | | | | | | | | | | | | | | | | | Fix YUV software-decoded video playback for frame with padded strides. * Use per-plane stride info from VideoFrame for source image rect width, when uploading a CPU-allocated video frame. * Modify cc::TextureUploader to handle non-4-byte-aligned texture uploads. * Add testcase UploadContentsTest to check texture upload paths. * Add RoundDown()/RoundUp() to base::bits and use them in media::VideoFrame and cc::TextureUploader. BUG=chromium:160622, chromium:161023 TEST=local build, run on x86 Review URL: https://chromiumcodereview.appspot.com/11413005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168970 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Turn SharedQuadState into a struct-like class similar to DrawQuads.danakj@chromium.org2012-11-2119-75/+88
| | | | | | | | | | | | | | | | | | | | | | SharedQuadState was a struct previously, but required all the data to be passed to its create() method. This makes the Create() method take no parameters, as DrawQuads work now. And we add a SetAll() method, similar again to DrawQuad. We remove the "id" value from ShardQuadState. This shouldn't be needed for serialization. We can instead just use the pointers in the quads as an id directly, and compare them against each other to see when we need to create a new shared quad state. This is sufficient since all quads that share an instance of SharedQuadState are appended to be adjacent in the quad list. Covered by existing tests. TBR=aelias BUG=152337 Depends on: https://codereview.chromium.org/11411050 Review URL: https://chromiumcodereview.appspot.com/11416088 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168960 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Increase 'small animated layer' size.epenner@chromium.org2012-11-203-22/+26
| | | | | | | | | | | On Nexus 10 upstream in content shell, some transition layers are 80 pixels larger than the viewport. Use one tile padding instead, as the layer is padded to that size anyway. BUG=159937 Review URL: https://chromiumcodereview.appspot.com/11316034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168907 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Make the DrawQuad subclasses into a struct-like classes.danakj@chromium.org2012-11-2045-646/+1220
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've replaced the create() and constructor on each class with a SetNew() method: void SetNew(const SharedQuadState* shared_quad_state, gfx::Rect rect, ...); This method sets everything in the base class, based on the subclass' interpretation of the minimal parameters given to it. This is used when creating a new quad of this type - hence the name. The "..." represents all the quad-type-specific arguments. I've also added a new SetAll() method, that takes all of the data held by this quad type, and simply passes on the appropriate things to the super class: void SetAll(const SharedQuadState* shared_quad_state, gfx::Rect rect, gfx::Rect opaque_rect, gfx::Rect visible_rect, bool needs_blending, ...); This method is used for deserializing, or other cases where you have all the data for the quad well defined, and want to set every field at once. The "..." represents all the quad-type-specific arguments. Added tests for SetAll() in cc_unittests:DrawQuadTest.* TBR=aelias BUG=152337 Review URL: https://chromiumcodereview.appspot.com/11411050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168903 0039d316-1c4b-4281-b951-d872f2087c98
* ui: Add methods to Rect classes to get points at each of the rect's corners.danakj@chromium.org2012-11-208-40/+8
| | | | | | | | | | | | | | | | | | | | This adds the following methods: RectBase::TopRight() RectBase::BottomLeft() RectBase::BottomRight() RectBase::origin() still provides the rect's top-left corner. Tests: ui_unittests:RectTest.Cornders BUG=147395 R=sky Review URL: https://chromiumcodereview.appspot.com/11358240 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168859 0039d316-1c4b-4281-b951-d872f2087c98
* Explicitly unlink any textures that exceed the texture budget.ccameron@chromium.org2012-11-202-14/+44
| | | | | | | | | BUG=160682 Review URL: https://chromiumcodereview.appspot.com/11359183 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168766 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Make UV coords in TileDrawQuad a full RectFenne@chromium.org2012-11-2011-37/+57
| | | | | | | | | | | | | | | | | | | Previously, TileDrawQuad assumed that texels were 1:1 with geometry, so it only needed an offset into the texture to calculate the UVs. For impl-side painting where multiple contents scales might be in play, a given texture rect isn't going to be 1:1 with geometry rects and also will not be necessarily integer aligned. Also, some things (like edge antialiasing) still need to know the texture size so that it can do half-texel offsets, so this new texture rect needs to stay in "texel space" rather than 0-1 "uv space". R=danakj@chromium.org BUG=155209 Review URL: https://chromiumcodereview.appspot.com/11348109 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168723 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes for nonmodal pinch zoom.aelias@chromium.org2012-11-202-5/+23
| | | | | | | | | | | | | | | | | In Android 4.2, pinch gestures send both pinch events (for the zoom-in/out part of the pinch) and scroll events (for double-finger panning). The previous logic in LayerTreeHostImpl created a pan from the pinch event, resulting in 2x overpanning on Android 4.2. In order to have compatible gesture generation in older Android versions as well, I copy-pasted the latest Android GestureDetector.java file into the Chromium tree and use that instead of the system file. BUG=161909 Review URL: https://chromiumcodereview.appspot.com/11299083 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168721 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Enable all animations on Android.epenner@chromium.org2012-11-202-0/+13
| | | | | | | | | | | We are already shipping this way, and disabling some animations causes performance regressions. BUG=129683 Review URL: https://chromiumcodereview.appspot.com/11316036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168686 0039d316-1c4b-4281-b951-d872f2087c98
* Implement unit tests and temporary MathUtil wrappers for transform functionalityshawnsingh@chromium.org2012-11-193-0/+1097
| | | | | | | | | | | | | These unit tests and wrappers have a short-term home in MathUtil so that we can safely migrate from WebTransformationMatrix to gfx::Transform in a follow-up patch. After the migration, we will then proceed to phase out this temporary code and beef up ui/gfx/transform.h nicely. BUG=159972 Review URL: https://codereview.chromium.org/11316043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168571 0039d316-1c4b-4281-b951-d872f2087c98
* Relax assertions around context loss and program initialization. Higher ↵kbr@chromium.org2012-11-173-23/+26
| | | | | | | | | | | | level code will take care of issuing repaints as necessary. BUG=161571 TEST=GPUCrashTest.Kill in Debug mode on Windows Review URL: https://chromiumcodereview.appspot.com/11415040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168464 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Turn DrawQuad into a struct-like class with public data members.danakj@chromium.org2012-11-1726-209/+208
| | | | | | | | | | | | | | | | | | | We add a SetAll() method that sets everything to keep the compile-time guard that verifies everything gets set from all appropriate callsites. This replaces the constructor which now takes no arguments at all. We will replace the constructor with an overriding SetAll() for each subclass of DrawQuads and make them into structs as well. Covered by existing tests. TBR=aelias BUG=152337 NOTRY=true Review URL: https://chromiumcodereview.appspot.com/11418047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168460 0039d316-1c4b-4281-b951-d872f2087c98
* Add Shawn and Alex as cc/OWNERSjamesr@chromium.org2012-11-171-2/+2
| | | | | | | | | BUG= Review URL: https://chromiumcodereview.appspot.com/11415035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168452 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Convert DrawQuad to chromium style.danakj@chromium.org2012-11-1724-246/+239
| | | | | | | | | | | | | | | | | | We leave the methods as methods instead of structifying it in this CL. But the opaqueRect() helper method on DrawQuad is moved out to the call sites. DrawQuad::needsBlending() is moved to DrawQuad::ShouldDrawWithBlending() which combines together various states. DrawQuad::opaqueRect() is computed in QuadCuller, and is used more cleverly in ShouldDrawWithBlending(). TBR=aelias BUG=152337 Review URL: https://chromiumcodereview.appspot.com/11420044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168423 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Add ThrottledVSyncInterval counter.reveman@chromium.org2012-11-172-1/+2
| | | | | | | | | | | | This makes it much easier to notice dropped frames in traces. BUG= TEST=manual Review URL: https://chromiumcodereview.appspot.com/11414008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168412 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Remove opaque flags from SharedQuadState and DrawQuaddanakj@chromium.org2012-11-1734-102/+116
| | | | | | | | | | | | | | | | | | | | | | | | | Now we will use the opaqueRect (already present on DrawQuad) to tell when things are opaque or not. Each Quad constructor that can be opaque take an opaqueRect. Generally, callers set it equal to the quadRect when contentsOpaque(). TiledLayerImpl can set it to a smaller rect sometimes since it has more knowledge. This made the scrollbar code a bit nicer for the thumb so that it doesn't need to set needs_blending anymore, as the thumb can be marked non-opaque. DebugBorderQuad sets an empty opaqueRect now, so it doesn't need to set needs_blending. Covered by existing tests. BUG=152337 R=enne Review URL: https://chromiumcodereview.appspot.com/11412044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168387 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Switch time_source.h and timing_function* to Chrome coding style.tfarina@chromium.org2012-11-165-95/+94
| | | | | | | | | | BUG=144576,144577 TEST=cc_unittests R=jamesr@chromium.org Review URL: https://codereview.chromium.org/11411024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168302 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Switch the DrawQuad enum names to chromium style and remove pragmasdanakj@chromium.org2012-11-1625-128/+88
| | | | | | | | | | | Some cleanup in the direction of making DrawQuad a chromified struct. R=enne BUG=152337 Review URL: https://codereview.chromium.org/11417035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168301 0039d316-1c4b-4281-b951-d872f2087c98
* Add API for hit testing layer_impl touchEventHandlerRegions from the hostyusufo@chromium.org2012-11-166-1/+482
| | | | | | | | | | | | | | These APIs will be used for hit testing touchEvents on the compositor. Currently all touch events coming through input_event_filter return DidNotHandle. Using this check we will be able to check the touch Ppoint against the touchEventHandlerRegion in all layer_impls and return DropEvent if there are no hits. BUG=135818 Review URL: https://chromiumcodereview.appspot.com/11402002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168294 0039d316-1c4b-4281-b951-d872f2087c98
* First draft of TileManager's tile prioritzation systemnduca@chromium.org2012-11-167-162/+302
| | | | | | | | | | BUG=155209 R=enne@chromium.org Review URL: https://chromiumcodereview.appspot.com/11417002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168175 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Move the HUD debug colors into the cc::DebugColors classdanakj@chromium.org2012-11-163-22/+95
| | | | | | | | | R=enne BUG=160867 Review URL: https://chromiumcodereview.appspot.com/11280012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168160 0039d316-1c4b-4281-b951-d872f2087c98
* Switched cc::Resource and cc::ScopedResource to Chrome coding style.skaslev@chromium.org2012-11-1612-107/+98
| | | | | | | | BUG=144576,144577 Review URL: https://chromiumcodereview.appspot.com/11412022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168152 0039d316-1c4b-4281-b951-d872f2087c98
* Handle NinePatchLayer Resource Rebuilding.dtrainor@chromium.org2012-11-163-8/+31
| | | | | | | | | | | | | | | | When we minimize the application our PrioritizedResourceManager dies. This clears the PrioritizedTexture state and decouples the texture from the manager. When we bring our application back to the foreground a new PrioritizedResourceManager is created, but we still hold onto our old PrioritizedResource. Trying to reupload a bitmap on this resource fails due to a variety of DCHECK/CHECKs at this point. Now if the PrioritizedResource has no PrioritizedResourceManager we rebuild the resource. BUG=http://crbug.com/161278 Review URL: https://chromiumcodereview.appspot.com/11420021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168122 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Create cc::DebugColors class to hold all the debugging color/width ↵danakj@chromium.org2012-11-167-66/+145
| | | | | | | | | | | | | | | constants. This class has a bunch of static methods that provide colors and widths of debugging visualizations. It also will make things wider based on the current device scale factor, when it is available. R=enne BUG=160867 Review URL: https://codereview.chromium.org/11316026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168087 0039d316-1c4b-4281-b951-d872f2087c98
* Set contents texture manager's limit to something reasonablejamesr@chromium.org2012-11-156-9/+11
| | | | | | | | | | | | Otherwise, if we compositeAndReadback() before doing any 'normal' commits the contents texture limit is 0 and we get no stuffs. This mainly impacts layout tests. BUG= Review URL: https://codereview.chromium.org/11363254 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168037 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Add PictureLayerTiling for impl-side paintingenne@chromium.org2012-11-157-3/+387
| | | | | | | | | | | | | This adds an interface for generating/iterating/creating tiles and tilings. PictureLayerImpl now knows a lot less about the internals of the tiling (yay). TBR=nduca@chromium.org BUG=155209 Review URL: https://chromiumcodereview.appspot.com/11377176 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167997 0039d316-1c4b-4281-b951-d872f2087c98
* Avoid using WebTransformationMatrix::translateRight*vollick@chromium.org2012-11-151-2/+2
| | | | | | | | | | | This will make migrating to gfx::Transform simpler. BUG=147395 R=enne@chromium.org Review URL: https://codereview.chromium.org/11361067 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167913 0039d316-1c4b-4281-b951-d872f2087c98
* Always use border texels on layer tiles. We already did that on certain ↵alokp@chromium.org2012-11-153-17/+1
| | | | | | | | | | | platforms. This patch extends it to all platforms. BUG=160072 Review URL: https://chromiumcodereview.appspot.com/11360205 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167870 0039d316-1c4b-4281-b951-d872f2087c98
* Added some instrumentation to the software compositor.skaslev@chromium.org2012-11-152-0/+8
| | | | | | | | | BUG=124671 Review URL: https://chromiumcodereview.appspot.com/11363251 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167843 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Visualize non-occluding rects in composited layers.danakj@chromium.org2012-11-1511-9/+53
| | | | | | | | | | | | | | | | | | | | | | | | Adds a new flag to show non-occluding rects. When this flag is on, then for any layer which could have been occluding, but isn't we show a rectangle on the screen. This means for layers that have 3d transforms and would never be occluding, we don't draw rectangles. For axis aligned rectangles with opacity < 1, we don't draw rectangles. But when a layer has opacity=1, is axis aligned, but its contents are not considered opaque, then we draw a rect to warn the user that this area could have been occluding if only its contents had been considered opaque. New command-line flag: --show-nonoccluding-rects R=jamesr,enne BUG=160643 Review URL: https://codereview.chromium.org/11377122 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167816 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Add support for debugging layer borders directly in the compositordanakj@chromium.org2012-11-1511-70/+58
| | | | | | | | | | | | | | | Instead of supporting --show-composited-layer-borders via the GraphicsLayer debug borders mechanism, show debug borders on layers when the new LayerTreeSetting flag showDebugBorders is enabled. This depends on https://bugs.webkit.org/show_bug.cgi?id=102130 BUG=159769 R=jamesr,enne Review URL: https://chromiumcodereview.appspot.com/11365239 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167815 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Fix comment about screenspace transform.danakj@chromium.org2012-11-151-1/+1
| | | | | | | | | | BUG=160834 R=enne,shawnsingh Review URL: https://chromiumcodereview.appspot.com/11366252 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167781 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Clamp the fixed thumb size to be at least zero.danakj@chromium.org2012-11-141-1/+3
| | | | | | | | | | | | | WebKit is providing a negative thumb size sometimes, which causes asserts in gfx::Size once we re-enable those DCHECKs. BUG=160799 R=enne Review URL: https://chromiumcodereview.appspot.com/11365247 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167766 0039d316-1c4b-4281-b951-d872f2087c98
* improving UI of FPS counteregraether@chromium.org2012-11-145-50/+95
| | | | | | | | | | | | | | | | | | The FPS counter shows the frame rate based on a time-stamp history and is located in the compositor's HUDLayer. This change includes: - moving to top right corner - plotting the graph's X-axis based on time between frames - measuring min/max value instead of standard deviation - showing histogram of time spent in each value - scaling to the max value in case of very high fps (disabled vsync) comparison images: https://docs.google.com/folder/d/0B8Y78t3tjy1XTC1OYzUySFgwODQ/edit Review URL: https://chromiumcodereview.appspot.com/11369200 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167765 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Layer that have empty bounds should still have their contentsScale ↵danakj@chromium.org2012-11-142-21/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | applied in their transforms. The change to add contentsScaleX() and contentsScaleY() allows layers to move between their layer and content space even when they have empty bounds. Now new code is moving between these spaces by multiplying these scale factors, regardless of the layer's bounds, and this seems like the correct thing to do. However, LayerTreeHostCommon is still only applying contentsScaleX|Y() only when the bounds are not empty. This is inconsistent with other code, and ends up causing confusion elsewhere, such as in the scrolling and hit testing code. We remove the if() conditions on the bounds in LTHCommon, so that the transforms on any layer match the contentsScales on that layer. Tests: cc_unittests:LayerTreeHostCommonTest.verifyLayerTransformsInHighDPI cc_unittests:LayerTreeHostCommonTest.verifyContentsScale BUG=160834 R=enne Review URL: https://chromiumcodereview.appspot.com/11312226 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167764 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Remove cc::settings, move them to LayerTreeSettings.danakj@chromium.org2012-11-1421-264/+63
| | | | | | | | | | | | | | | | For now, we don't want to make plumbing through the WebKit API for all these settings. So they are marked with a TODO to move into chromium. When we are no longer going through the WebKit API from chromium, we can set these settings in chromium, instead of reading the command-line parameters in cc. Depends on: https://bugs.webkit.org/show_bug.cgi?id=102146 R=jamesr BUG=160771 Review URL: https://chromiumcodereview.appspot.com/11361223 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167750 0039d316-1c4b-4281-b951-d872f2087c98
* Added support for CSS filters to the software compositor.skaslev@chromium.org2012-11-141-0/+9
| | | | | | | | | BUG=160302 Review URL: https://chromiumcodereview.appspot.com/11362235 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167747 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Return whether any layer was scrolled from InputHandlerClient::scrollBy.sadrul@chromium.org2012-11-144-6/+40
| | | | | | | | BUG=none Review URL: https://codereview.chromium.org/11365238 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167721 0039d316-1c4b-4281-b951-d872f2087c98
* cc: remove jank instead of checkerboard settingenne@chromium.org2012-11-145-16/+2
| | | | | | | | | | | | This was merely a prototyping setting. It turns out (surprise!) that nobody likes jank, so we can get rid of this. R=danakj@chromium.org BUG=none Review URL: https://codereview.chromium.org/11377111 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167697 0039d316-1c4b-4281-b951-d872f2087c98
* ui: Remove implicit flooring in skia rect conversion methods.danakj@chromium.org2012-11-141-27/+18
| | | | | | | | | | | | | | | | | | | The current SkRectToRect method implicitly floors all components of thre rect and this is bad. Replace this method with SkRectToRectF which keeps everything as floating point. We also add a conversion method from RectF to SkRect. Tests: ui_unittests:RectTest.SkiaRectConversions R=sky BUG=147395 Moved From: https://codereview.chromium.org/11275089/ Review URL: https://chromiumcodereview.appspot.com/11359172 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167620 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Clean up PageScaleAnimation for readability.aelias@chromium.org2012-11-144-53/+49
| | | | | | | | | | | No-op change. BUG=152505 Review URL: https://chromiumcodereview.appspot.com/11364189 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167615 0039d316-1c4b-4281-b951-d872f2087c98
* Use message passing for BeginFrameAndCommitState and clean up forced commit ↵jamesr@chromium.org2012-11-148-87/+216
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | logic This passes the BeginFrameAndCommitState struct along with messages instead of relying on (racy) shared memory and slightly simplifies the forced commit logic. This logic is for compositeAndReadback() and is trying to go through the normal commit flow while the main thread is blocked. The normal commit flow is this: 1.) Main thread posts task to compositor thread requesting commit 2.) Compositor thread receives notification, after some delay posts task to main to run the beginFrame logic 3.) Main thread runs the beginFrameTask, posts a blocking task to compositor thread 4.) With the main thread is blocked, compositor thread runs the beginFrameComplete task and signals the main thread to get on with life 5.) Compositor thread waits for an opportunity to draw (vsync) then goes back to the initial state. compositeAndReadback() requires that we run through the whole flow up through 5 without yielding the main thread at all. However, while it's doing this there may very well be another beginFrame task pending on the main thread's message queue. When this task does eventually run it needs to have a valid BFAC state and the reply has to be expected on the compositor side. This patch always passes the BFAC state on the beginFrame task and uses a null BFAC state for compositeAndReadback-forced beginFrame()s. This means when we do a compositeAndReadback we won't "see" state that has updated only on the compositor thread, but that's fine since we'll apply that state once we process the beginFrame task later on and BFAC state addition is additive. The tricky bit from the compositor side is keeping track of whether there's a pending beginFrame message after going through the forced commit flow. To keep track of this I've added SchedulerStateMachine::m_expectImmediateBeginFrame that keeps the scheduler in a state that expects a beginFrameComplete after finishing the readback. Typical flow: 1.) Main thread enters compositeAndReadback(), posts a blocking forceBeginFrame task to compositor thread 2.) Compositor thread posts beginFrame task to main thread 3.) Compositor thread processes forceBeginFrame task, sets scheduler bits, signals main thread to continue 4.) Main thread runs beginFrame(NULL), posts beginFrameComplete to compositor thread 5.) Compositor thread processes beginFrameComplete, runs through state machine up to draw and then goes back to waiting for a reply to the beginFrame it posted in step (2) 6.) Main thread issues sync readback, finishes compositeAndReadback() 7.) Main thread processes beginFrame message posted in (2), posts reply 8.) Profit! Note that steps (2) and (3) can happen in any order. BUG=158747 Review URL: https://chromiumcodereview.appspot.com/11362054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167537 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 167255 - ui: Remove gfx::Size::ClampToNonNegative, prevent negative ↵shawnsingh@chromium.org2012-11-131-1/+1
| | | | | | | | | | | | | | | | | | | | | sizes always. This was added with the intention of using Size as a vector, replacing use of IntSize. Since we have Vector2d now, negative sizes should not exist, so clamp them in set_width/set_height and the constructor. Not covered by tests, as we can't test DCHECKs. TBR=sky BUG=160158 Relanding: https://codereview.chromium.org/11365160/ Review URL: https://codereview.chromium.org/11410024 TBR=danakj@chromium.org Review URL: https://codereview.chromium.org/11359194 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167504 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Add command line flags for the various show rect debugging features.danakj@chromium.org2012-11-133-0/+32
| | | | | | | | | | | | | | | | | | | | | Add command line flags for everything except showPaintRects, as this is already a part of WebSettings and passed in via WebKit. This needs to be resolved with the others once we sort out the future method of passing in settings to the compositor. The new flags are: --show-property-changed-rects --show-surface-damage-rects --show-screenspace-rects --show-replica-screenspace-rects --show-occluding-rects BUG=160643 R=enne,jamesr Review URL: https://codereview.chromium.org/11366212 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167484 0039d316-1c4b-4281-b951-d872f2087c98
* Avoid redundantly setting tex parametersjamesr@chromium.org2012-11-1311-47/+48
| | | | | | | | | BUG= Review URL: https://chromiumcodereview.appspot.com/11366199 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167479 0039d316-1c4b-4281-b951-d872f2087c98
* Remove crash instrumentation, since we haven't seen a crash inccameron@chromium.org2012-11-135-61/+1
| | | | | | | | | | | | a long time (Canary just got some with single-threaded proxy, but that's a different issue). BUG=151428 Review URL: https://chromiumcodereview.appspot.com/11363207 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167317 0039d316-1c4b-4281-b951-d872f2087c98
* [cc] Fix crash when adding a child layer to its own parent.tedchoc@chromium.org2012-11-132-1/+19
| | | | | | | | | | | | Only calculate the index after calling removeFromParent in case it modifies the number of children. BUG= Review URL: https://chromiumcodereview.appspot.com/11377108 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167315 0039d316-1c4b-4281-b951-d872f2087c98