summaryrefslogtreecommitdiffstats
path: root/cc/layers/render_surface_impl.cc
Commit message (Collapse)AuthorAgeFilesLines
* Clean up function names with from property treesweiliangc2016-03-031-19/+24
| | | | | | | | | | | | | Now we are always using property trees, the names saying from property trees are redundant. BUG= R=enne CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1751983002 Cr-Commit-Position: refs/heads/master@{#379042}
* Delete CalcDrawPropsweiliangc2016-02-191-9/+0
| | | | | | | | | | | | | | We always use property trees. Delete CalcDrawProps. Delete |use_property_trees| because it's always true. Delete |verify_property_trees| because we don't have CDP to verify against. R=enne, piman, ajuma, vollick, dtrainor BUG=581832 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1706903002 Cr-Commit-Position: refs/heads/master@{#376337}
* Remove DelegatedRendererLayerjbauman2016-02-091-20/+0
| | | | | | | | | | | We now use SurfaceLayer instead in all cases. BUG=579275 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1675023002 Cr-Commit-Position: refs/heads/master@{#374311}
* cc cleanup: simplify mask_uv_scale and MaskUVRect().senorblanco2016-01-271-3/+2
| | | | | | | | | | | | | | | | RenderPassDrawQuad::MaskUVRect() computes the UV rect by scaling the quad->rect() by mask_uv_scale, then dividing by quad->rect size. However, RenderSurfaceImpl::AppendQuads() computes the mask UV scale as quad->rect() size / mask size. So let's just take the quad->rect() size out of mask_uv_scale in the first place, so we don't have to divide it back out in MaskUVRect(). BUG= CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1647573002 Cr-Commit-Position: refs/heads/master@{#371879}
* cc:: Remove RenderSurfaceImpl::TargetEffectTreeIndexjaydasika2016-01-211-6/+0
| | | | | | | | | | | | | Need to remove it as it uses layer tree hierarchy information. It is used for computing surface draw opacity which can be computed directly from effect tree. BUG=568799 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1613583002 Cr-Commit-Position: refs/heads/master@{#370739}
* Accelerated filters should filter unpadded primitives.senorblanco2016-01-201-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until recently, the Skia image filter infrastructure could only produce a result image of the same size as its input image. For that reason, currently Blink applies filter outsets to a layer before it passes the layer to cc. So cc sees a layer padded with transparent black out to the filter outsets, but has no idea how big the original layer was. It then passes that to Skia, which produces an image of the same size. I've recently fixed Skia to be able to correctly draw from the original (unpadded) texture size to the correct, padded texture size. But to take advantage of that, we need Blink to stop padding the texture (see PaintLayer). This may result in a destination buffer which is of a different size than the source, so we modify cc's drawing to draw the destination rect. Also, since we're giving the original (unmodified) source rect to Skia, we no longer need to offset the crop rects in Blink by the delta between the src and dest rects. (Note: we can thus remove the crop offset stuff entirely from Blink, which I'll do in a followup patch.) Finally, note that the workaround for the partially-occupied textures implemented (implemented in https://codereview.chromium.org/909353003) was no longer working when drawing to exact-size textures, due to a bug in SkAlphaThresholdFilter. This is fixed in Skia here: https://codereview.chromium.org/1609573002/. That will be required to roll into Chrome before this patch can be landed. BUG=568196 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1517693002 Cr-Commit-Position: refs/heads/master@{#370523}
* Use the correct variable in the DCHECKrobertn2016-01-051-1/+1
| | | | | | | | | | | | | | | | | | A patch changed how a value was retrieved to use a different variable, but the DCHECK was not updated to do the same. The change was introduced in the following CL: https://codereview.chromium.org/1479883002 TEST=Load youtube.com/tv, start a video and switch to a suggested video. The above steps will trigger the dcheck in content_shell. R=ajuma@chromium.org BUG=560275 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1556333003 Cr-Commit-Position: refs/heads/master@{#367527}
* Switch to standard integer types in cc/.avi2015-12-211-0/+2
| | | | | | | | | | BUG=138542 TBR=danakj@chromium.org CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1539203002 Cr-Commit-Position: refs/heads/master@{#366333}
* cc: Fix draw transform computation for non-drawn layersajuma2015-11-301-3/+6
| | | | | | | | | | | | | | | When property trees are enabled, draw properties are only computed for drawn layers. This means that when a non-drawn layer's draw transform is needed, it must be computed on-demand using the transform tree rather than being read from the layer's draw properties. BUG=560275 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1479883002 Cr-Commit-Position: refs/heads/master@{#362196}
* cc: Replace Pass() with std::move() in some subdirs.danakj2015-11-181-1/+1
| | | | | | | | | | | | | | | | | | | This hits the following: cc/layers/ cc/output/ cc/quads/ cc/resources/ cc/scheduler/ cc/surfaces/ cc/trees/ R=enne, vmpstr BUG=557422 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1455023002 Cr-Commit-Position: refs/heads/master@{#360405}
* Don't call gfx::ToEnclosedRect with a rect that has NaN coordinates.jaydasika2015-10-151-0/+8
| | | | | | | | | | | | | | | Due to large transforms the render surface's drawable content rect can end up with NaN coordinates. gfx::ToEnclosedRect crashes when called on a rect with NaN coordinates. This CL adds a NaN check in RenderSurfaceImpl::DrawableContentRect and also adds a unit test with large transform and NaN-coordinate rects. BUG=537684 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1407553002 Cr-Commit-Position: refs/heads/master@{#354274}
* gfx: Make conversions from Size to SizeF be explicit.danakj2015-09-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This removes the implicit operator from Size to SizeF and adds an explicit constructor instead. There are many places in the code that want to do: an_integer_size = ToFlooredSize(ScaleSize(an_integer_size, x)); This would make these all look like an_integer_size = ToFlooredSize(ScaleSize(gfx::RectF(an_integer_size), x)); But that's pretty verbose. So add helpers similar to those we have already for gfx::Rect, for when you want to scale a Size to a Size, such as an_integer_size = ScaleToFlooredSize(an_integer_size, x); R=sky@chromium.org, vmpstr BUG=342848 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1357423009 Cr-Commit-Position: refs/heads/master@{#350889}
* cc: Remove implicit conversions from Rect to RectF in src/cc/.danakj2015-09-051-3/+3
| | | | | | | | | | | | | This changes them to be explicit. I'd like to do this everywhere and then make such implicit conversion not possible in the gfx classes. R=enne, vmpstr BUG=342848 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1314943008 Cr-Commit-Position: refs/heads/master@{#347557}
* Compute Nearest Occlusion Immune Ancestor Outside CDPjaydasika2015-08-251-4/+0
| | | | | | | | | | | Nearest Occlusion Immune Ancestor computation is moved to CalculateRenderSurfaceLayerList. BUG=497817 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1316713002 Cr-Commit-Position: refs/heads/master@{#345405}
* Screen space and Draw Transfrom Of Replica layer of render surface from ↵jaydasika2015-08-251-0/+4
| | | | | | | | | | | Property trees BUG=497817 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1309843002 Cr-Commit-Position: refs/heads/master@{#345246}
* Render Surface Content Rect from property treesjaydasika2015-08-211-0/+22
| | | | | | | | | | | | | | | | | | | The content rect of a render surface is the union of drawable content rects of all layers that draw into it intersected with the clip rect of render surface if it is clipped. As the layer tree will be gone post slimming paint v2, calculating the content rects by walking the layer tree is not a good idea. Also, the content rect is required in CalculateRenderSurfaceLayerList, so we can't do the computation after this function seperately. So, the content rect computation is in CalculateRenderSurfaceLayerList function itself and is computed for the surface before it is used by the function. CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1291283007 Cr-Commit-Position: refs/heads/master@{#344683}
* Draw Opacity of Render Surface from Property Treesjaydasika2015-08-181-0/+10
| | | | | | | | CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1296883004 Cr-Commit-Position: refs/heads/master@{#344071}
* Render Surface is_clipped from Property Treesjaydasika2015-08-141-0/+4
| | | | | | | | | | | Render Surface is_clipped is computed in CDP. This patch computes it using property trees and checks that property tree computation matches CDP computation. CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1292473005 Cr-Commit-Position: refs/heads/master@{#343494}
* Draw Transform of Render Surface From Property Treesjaydasika2015-07-231-0/+3
| | | | | | Review URL: https://codereview.chromium.org/1248433007 Cr-Commit-Position: refs/heads/master@{#340142}
* cc: Remove transforms_are_animating from render surfacesajuma2015-07-161-2/+0
| | | | | | | | | | | | This removes target_surface_transforms_are_animating_ and screen_space_transforms_are_animating_ from RenderSurface and RenderSurfaceImpl, since these are unused. CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1227953005 Cr-Commit-Position: refs/heads/master@{#339040}
* cc: Remove unused opacity animation properties from DrawPropertiesajuma2015-07-161-1/+0
| | | | | | | | | | | | This removes opacity_is_animating and screen_space_opacity_is_animating from DrawProperties, since no code (other than a single unit test) uses these values anymore. CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1240703008 Cr-Commit-Position: refs/heads/master@{#339021}
* cc: Rename visible_content_rect and content stuff on quads.danakj2015-06-191-11/+6
| | | | | | | | | | | | | | | This renames visible_content_rect to visible_layer_rect. And for SharedQuadState renames the transforms and rects to no longer refer to "content" and instead refer to the space the the DrawQuad rects. R=enne, vmpstr TBR=dcheng BUG=413479 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1175113010 Cr-Commit-Position: refs/heads/master@{#335172}
* cc: Remove layer contents_scale_x() and contents_scale_y().danakj2015-06-181-2/+0
| | | | | | | | | | | | | These are always 1 now that ContentsScalingLayer does not exist. So just remove them, and the fields in DrawProperties. R=enne, vmpstr BUG=413479 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1180073016 Cr-Commit-Position: refs/heads/master@{#335000}
* cc: Remove the layer content_bounds() and use bounds() instead.Dana Jansens2015-06-181-4/+3
| | | | | | | | | | | | | | And remove the content_bounds from DrawProperties. They are always equal now (outside of some legacy tests). R=enne@chromium.org, enne, vmpstr BUG=413479 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1179133004. Cr-Commit-Position: refs/heads/master@{#334979}
* Rename cc::ResourceProvider::ResourceId to cc::ResourceId and move it to its ↵jbauman2015-05-191-1/+1
| | | | | | | | | | own file. This allows files like surface_resource_holder.h and transferable_resource.h to depend on the typedef without depending on resource_provider.h Review URL: https://codereview.chromium.org/1144523003 Cr-Commit-Position: refs/heads/master@{#330459}
* cc: Stop passing OcclusionTracker to RenderSurfaceImpl.danakj2015-02-111-50/+34
| | | | | | | | | | | | | | | | | | | | | | This moves the code to grab the Occlusion off the tracker out to LayerTreeHostImpl. But the Occlusion depends on which draw transform to use, which depends on it being a replica or not. Since the decision to AppendQuads for a replica or not happens in LayerTreeHostImpl, we can branch there to decide which draw transform, occlusion, mask, and debug borders to use so that the logic is not split between two sites. Now |for_replica| is not passed to RenderSurfaceImpl::AppendQuads either. This removes one need to use an OcclusionTracker when walking layers to draw. R=enne, vmpstr BUG=446751 Review URL: https://codereview.chromium.org/914813003 Cr-Commit-Position: refs/heads/master@{#315834}
* cc: Remove OcclusionTracker::UnoccludedContributingSurfaceContentRect.danakj2015-02-111-2/+3
| | | | | | | | | | | | | | Instead have OcclusionTracker return an Occlusion object for use with a RenderSurface (or a replica), and call GetUnoccludedContentRect on that Occlusion object instead. This lets us avoid passing an OcclusionTracker to RenderSurfaceImpl during AppendQuads. R=enne, vmpstr BUG=446751 Review URL: https://codereview.chromium.org/917543002 Cr-Commit-Position: refs/heads/master@{#315710}
* cc cleanup: Update paths to geometry headersheejin.r.chung2014-10-231-1/+1
| | | | | | | | | | | Geometry headers were moved from /ui/gfx/ to ui/gfx/geometry. Updating includes accordingly. BUG=395370 Review URL: https://codereview.chromium.org/660333004 Cr-Commit-Position: refs/heads/master@{#300902}
* Include mask texture size in RenderPassDrawQuadenne2014-10-161-16/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to support GL_TEXTURE_RECTANGLE_ARB, cc::GLRenderer needs to know the size of the mask texture to unnormalize the texture coordinates. This has already been done for TileDrawQuad. As an optimization, rather than adding two more members onto the already bloated RenderPassDrawQuad, turn mask_uv_rect into mask_uv_scale. The position of the mask is now assumed to always be at the origin of the quad's transform, which it always is in cc. This is equivalent to saying that the mask is always attached to the owning layer of a render surface (since that's what defines the transform origin of the render surface). By making this assumption, the old mask_uv_rect can be calculated in a helper function from just quad->rect and quad->mask_uv_scale. With this patch, mask_texture_size is currently unused, but its values are unit tested. Depends on https://codereview.chromium.org/652393002/ R=danakj@chromium.org,jamesr@chromium.org BUG=423533 Review URL: https://codereview.chromium.org/659683002 Cr-Commit-Position: refs/heads/master@{#299932}
* [C++11 Allowed Features] Declares a type-safe null pointer converting from ↵kulkarni.a2014-10-101-3/+3
| | | | | | | | | | NULL to nullptr in src/cc [part-2] BUG = Review URL: https://codereview.chromium.org/643583003 Cr-Commit-Position: refs/heads/master@{#299106}
* Make RenderPass::Id an isolated classweiliangc@chromium.org2014-08-221-4/+4
| | | | | | | | | | | | | Move RenderPass::Id out of RenderPass and make it an isolated class called RenderPassId, so RenderPassDrawQuad and AppendQuadsData will not need to depend on entire RenderPass class. BUG=344962 Review URL: https://codereview.chromium.org/404563005 Cr-Commit-Position: refs/heads/master@{#291403} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@291403 0039d316-1c4b-4281-b951-d872f2087c98
* Remove unused RenderPassDrawQuad fieldsdanakj@chromium.org2014-08-121-8/+0
| | | | | | | | | | | | | | | | | | | | | The contents_changed_since_last_frame and is_replica fields are not used. Also removes RenderSurfaceImpl's ContentsChanged() as this method was only used in determining the value of contents_changed_since_last_frame. Unfortunately now RenderPassDrawQuad is only the largest quad type on 64-bit builds. So, adds kLargestQuadType to cc/quads/ and moves the largest-quad-type unit test there verifying that kLargestQuadType is the largest now, instead of RenderPassDrawQuad. R=enne BUG=401481 NOTRY=true Review URL: https://codereview.chromium.org/448133002 Cr-Commit-Position: refs/heads/master@{#289091} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289091 0039d316-1c4b-4281-b951-d872f2087c98
* Implement HiDPI and pinch-zoom scaling of filter paramsgarykac@chromium.org2014-08-081-0/+7
| | | | | | | | | | | | | | | | | | | This change implements HiDPI scaling of filter params in CC. It also fixes content scaling of filter params (e.g., with -webkit-transform: scale(X)) as well as pinch-zoom scaling. This code is mostly from http://crrev.com/191123002 "Implement hidpi and pinch-zoom scaling of filter params in cc" and replaces http://crrev.com/317663005 "Scale the ALPHA_THRESHOLD filter's region based on the device scale factor" because this fixes all filters rather than just the AlphaThresholdFilter. BUG=376532, 281516, 281518, 349493 R=brettw@chromium.org, danakj@chromium.org, enne@chromium.org, jschuh@chromium.org Review URL: https://codereview.chromium.org/394193003 Cr-Commit-Position: refs/heads/master@{#288436} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288436 0039d316-1c4b-4281-b951-d872f2087c98
* Create DrawQuad in RenderPass and only give out raw pointer to layersweiliangc@chromium.org2014-07-031-5/+4
| | | | | | | | | | | | | Instead of each layer calling Create function on DrawQuad and pass ownership around, create DrawQuad in RenderPass and only pass the raw pointer to layers. BUG=344962 TEST=cc_unittests Review URL: https://codereview.chromium.org/369623002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281306 0039d316-1c4b-4281-b951-d872f2087c98
* Removed QuadSink and MockQuadCullerweiliangc@chromium.org2014-06-231-10/+13
| | | | | | | | | | | | | | | Since QuadSink does not provide more functionatility than passing through to RenderPass and OcclusionTracker, it can be torn down and removed. Same is for MockQuadCuller. This CL follows 302603006, 306683002, 309493002. BUG=344962 TEST=cc_unittests Review URL: https://codereview.chromium.org/308193003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@279050 0039d316-1c4b-4281-b951-d872f2087c98
* Rendering context information added to SharedQuadStatethildebr@chromium.org2014-06-191-1/+2
| | | | | | | | | Context IDs given to DrawQuads to identify when a rendering context changes, and whether or not a DrawQuad is in a 3D sorting context. Review URL: https://codereview.chromium.org/332873005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278288 0039d316-1c4b-4281-b951-d872f2087c98
* Create SharedQuadState on RenderPassweiliangc@chromium.org2014-05-071-2/+1
| | | | | | | | | | | | | | | Instead of creating SharedQuadState on layers and pass ownership around, create SharedQuadState on RenderPass and only pass the raw pointer to layers. Also let QuadCuller hold pointer to RenderPass instead of two points to DrawQuadList and SharedQuadStateList that is owned by RenderPass. BUG=344962 TEST=cc_unittests Review URL: https://codereview.chromium.org/265823015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268785 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Change damage tracking from floats to integers.danakj@chromium.org2014-04-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Damage rects can become huge when layers clip the viewport, and in some cases become so large that we reach inaccurate floating point representation of the whole-number portion, which we fail to handle correctly when doing gfx::ToEnclosingRect. Int/float conversions are also slow, and the GL_SCISSOR wants integers eventually anyway, so keeping track of partial-pixel damage is not buying us much here. So convert the DamageTracker to use integer rects. Also change cc::RenderSurfaceImpl to export a damage_rect that is contained inside the output_rect for the RenderPass, and add DCHECKs to cc::RenderPass to ensure we don't send pointlessly large damage_rects to the cc::Renderer. Tests: DamageTrackerTest.HugeDamageRect R=enne@chromium.org, piman@chromium.org BUG=355514 Review URL: https://codereview.chromium.org/226183007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262160 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Apply occlusion before creating quads in RenderSurfaceImpl.danakj@chromium.org2014-03-211-6/+9
| | | | | | | | | | | | | | | | This makes the AppendQuads method query occlusion directly and subtract it from the quads it would create before they are created, skipping quads that are completely occluded and avoiding a malloc/free for them. Depends on: https://codereview.chromium.org/205443002/ Depends on: https://codereview.chromium.org/203463015/ R=enne BUG=344962 Review URL: https://codereview.chromium.org/205503002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@258633 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Rename QuadSink::Append to MaybeAppend.danakj@chromium.org2014-03-131-2/+2
| | | | | | | | | | | | | This touches a lot of files, so keep it mindless. Then we can add another append that does not do culling, and move callsites over one at a time. R=enne BUG=344962 Review URL: https://codereview.chromium.org/196533010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256754 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Remove the AppendQuadsData from QuadSink::Append.danakj@chromium.org2014-03-121-2/+2
| | | | | | | | | | | The variable was unused, so drop it. R=enne BUG=344962 Review URL: https://codereview.chromium.org/194573009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256466 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Add visible_rect to Draw*Quad::SetNew().danakj@chromium.org2014-03-071-1/+6
| | | | | | | | | | | | | | | Currently the visible_rect is implicitly set to the quad's |rect| value then later changed by the occlusion/culling code. Instead we want to compute this value up front and set it on the quad when the quad is created. So add it to the SetNew() method. Currently it should always be set to the same value as the |rect|. R=enne BUG=344962 Review URL: https://codereview.chromium.org/185563008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255662 0039d316-1c4b-4281-b951-d872f2087c98
* Plumb debug name via debug infovollick@chromium.org2014-01-151-6/+0
| | | | | | | | | | | | | There used to be a separate channel for plumbing back a layer's debug name. The debug info object is more general, and we can just send the debug name through it. This patch depends on https://codereview.chromium.org/135473002/ R=jamesr@chromium.org BUG=None Review URL: https://codereview.chromium.org/135493002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244948 0039d316-1c4b-4281-b951-d872f2087c98
* Pass gfx::Rect and gfx::RectF by const ref.prashant.n@samsung.com2014-01-101-2/+2
| | | | | | | | | | | | | | | | | 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 bit fields inside cc to reduce memory usage.vivek.vg@samsung.com2013-12-101-1/+1
| | | | | | | | | | | | | | | | | | | | Using bitfields we get the memory usage as follows +-----+---------------------------+------------------------+---------+ |.No..|.Class/Structure/File......|.Size.of.object.(bytes).|.Memory..| |.....|...........................+------------------------+.Reduced.| |.....|...........................|...Before..|...After....|.........| +-----+---------------------------+-----------+------------+---------+ |..1..|.cc::Layer.................|......840..|.....824....|......16.| +-----+---------------------------+-----------+------------+---------+ |..2..|.cc::LayerImpl.............|......880..|.....864....|......16.| +-----+---------------------------+-----------+------------+---------+ |..3..|.cc::RenderSurfaceImpl.....|......408..|.....400....|.......8.| +-----+---------------------------+-----------+------------+---------+ Review URL: https://codereview.chromium.org/102733006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239682 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Reserve list sizes in RenderPass ctorenne@chromium.org2013-11-281-1/+1
| | | | | | | | | | | | This prevents needless dmallocs on Android. Originally implemented by tomhudson: https://codereview.chromium.org/40303003/ R=danakj@chromium.org BUG=309658 Review URL: https://codereview.chromium.org/86753002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237686 0039d316-1c4b-4281-b951-d872f2087c98
* The blink part of this implementation is uploaded at ↵rosca@adobe.com2013-11-261-1/+2
| | | | | | | | | | | | https://codereview.chromium.org/23511004/ The spec for mix-blend-mode is http://dev.w3.org/fxtf/compositing-1/#mix-blend-mode BUG=243223 Review URL: https://codereview.chromium.org/23455060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237295 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Mark render surfaces that ignore outside occlusion.alokp@chromium.org2013-11-171-1/+1
| | | | | | | | | | | | | Generalized RenderSurface::nearest_ancestor_that_moves_pixels to nearest_occlusion_immune_ancestor. Used this flag to mark render surfaces that have replica, copy-request, or filters that move pixels. BUG=307612 Review URL: https://codereview.chromium.org/40613004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235522 0039d316-1c4b-4281-b951-d872f2087c98
* Add support for converting cc::FilterOperations into an SkImageFilterajuma@chromium.org2013-09-261-1/+0
| | | | | | | | | | | | | | | | | This defines a new type of cc::FilterOperation for reference filters, and defines a method (RenderSurfaceFilters::BuildImageFilter) that builds an SkImageFilter from a given cc::FilterOperations. This also removes cc::Layer::SetFilter and cc::LayerImpl::SetFilter. These were only used when we had a reference filter, but they are no longer needed now that reference filters can be included in FilterOperations. BUG=181613 Review URL: https://codereview.chromium.org/21154002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225329 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Allow readbacks from hidden layers.danakj@chromium.org2013-07-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a layer or any of its ancestors has hide_layer_and_subtree() set to true, the layer will not be part of the compositor's output. But if we want to service a CopyOutputRequest on a layer in the hidden subtree, we need to draw it. This CL tracks visibility recursively in CalcDropProperties, so that when an output request exists in the subtree, we can avoid skipping the subtree, but make note that the layers in it are not visible (at least, until we recurse into the copy output requested layer). If a layer with an output request can not be drawn (it is clipped away/empty), then we abort the copy request and send an empty result. This is done for any remaining copy requests in the layer tree after we have taken requests that will be used and moved them onto RenderPasses. Tests: LayerTreeHostCommonTest.SubtreeHiddenWithCopyRequest LayerTreeHostCommonTest.ClippedOutCopyRequest LayerTreeHostTestAsyncReadbackInHiddenSubtree.RunSingleThread_DirectRenderer LayerTreeHostTestAsyncReadbackInHiddenSubtree.RunMultiThread_DirectRenderer_MainThreadPaint LayerTreeHostTestAsyncReadbackInHiddenSubtree.RunMultiThread_DirectRenderer_ImplSidePaint LayerTreeHostTestAsyncReadbackClippedOut.RunSingleThread_DirectRenderer LayerTreeHostTestAsyncReadbackClippedOut.RunMultiThread_DirectRenderer_MainThreadPaint LayerTreeHostTestAsyncReadbackClippedOut.RunMultiThread_DirectRenderer_ImplSidePaint LayerTreeHostTestHiddenSurfaceNotAllocatedForSubtreeCopyRequest.RunSingleThread_DirectRenderer LayerTreeHostTestHiddenSurfaceNotAllocatedForSubtreeCopyRequest.RunMultiThread_DirectRenderer_MainThreadPaint LayerTreeHostTestHiddenSurfaceNotAllocatedForSubtreeCopyRequest.RunMultiThread_DirectRenderer_ImplSidePaint R=enne BUG=242572 Review URL: https://chromiumcodereview.appspot.com/17619004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@210090 0039d316-1c4b-4281-b951-d872f2087c98