aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
Commit message (Collapse)AuthorAge
* Use BBH reserve hook to preallocate space for tiles.Gravatar mtklein2014-10-09
| | | | | | | | | | | | | | | | | | | | | | | | | Before getting too far into changing how SkTileGrid stores its tiles, I figured I'd better see how much I can tweak out the existing format. Cleverly, that way any improvements I make by changing the format will look that much less impressive. This CL looks like it will be a 5-15% win in time spent recording, with no effect on playback. This CL also shrinks the tiles to fit exactly when we're done inserting, using newly added SkTDArray::shrinkToFit(). It's quite cheap to run (maybe taking back 1-2% from those 5-15% wins), and means we'll lug around about 15% fewer bytes in the tile grids. Note though this strategy temporarily uses up to 30% more memory while building the tile grid. For our largest SKPs, that's maybe 75-100K extra. BUG=skia: Committed: https://skia.googlesource.com/skia/+/52455cbc02d7f480d988ae7cdacc11ad69078c2c CQ_EXTRA_TRYBOTS=tryserver.skia:Canary-Chrome-Ubuntu13.10-Ninja-x86_64-ToT-Trybot Review URL: https://codereview.chromium.org/639823005
* Remove unused SaveLayerInfo::fValid fieldGravatar robertphillips2014-10-09
| | | | | | Minor code cleanup Review URL: https://codereview.chromium.org/643713002
* Refactor GrLayerHoister::FindLayersToHoist to prep for adding clip to cache keyGravatar robertphillips2014-10-09
| | | | | | | | NOTRY=true Committed: https://skia.googlesource.com/skia/+/27415b71bd529456165945e19b5b7efbebf6fb51 Review URL: https://codereview.chromium.org/640373002
* FPs now use the correct builder types(just a rename)Gravatar joshualitt2014-10-09
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/648463003
* cleanup and optimize rect intersect routinesGravatar reed2014-10-09
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/640723004
* Revert of Use BBH reserve hook to preallocate space for tiles. (patchset #2 ↵Gravatar mtklein2014-10-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | id:80001 of https://codereview.chromium.org/639823005/) Reason for revert: failed assertion "fXTiles * fYTiles != 0" Original issue's description: > Use BBH reserve hook to preallocate space for tiles. > > Before getting too far into changing how SkTileGrid stores its tiles, I figured I'd > better see how much I can tweak out the existing format. Cleverly, that way > any improvements I make by changing the format will look that much less > impressive. > > This CL looks like it will be a 5-15% win in time spent recording, with no effect > on playback. > > This CL also shrinks the tiles to fit exactly when we're done inserting, > using newly added SkTDArray::shrinkToFit(). It's quite cheap to run (maybe > taking back 1-2% from those 5-15% wins), and means we'll lug around about 15% > fewer bytes in the tile grids. Note though this strategy temporarily uses up to > 30% more memory while building the tile grid. For our largest SKPs, that's > maybe 75-100K extra. > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/52455cbc02d7f480d988ae7cdacc11ad69078c2c TBR=reed@google.com,robertphillips@google.com,mtklein@chromium.org NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/642933002
* Store color and coverage stages in a single array in GrOptDrawState.Gravatar egdaniel2014-10-09
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/641223002
* Force linking of static member variables for GLProgramsGravatar joshualitt2014-10-09
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/614163002
* Revert of Refactor GrLayerHoister::FindLayersToHoist to prep for adding clip ↵Gravatar robertphillips2014-10-09
| | | | | | | | | | | | | | | | | | | | to cache key (patchset #1 id:1 of https://codereview.chromium.org/640373002/) Reason for revert: Failing unit tests Original issue's description: > Refactor GrLayerHoister::FindLayersToHoist to prep for adding clip to cache key > > NOTRY=true > > Committed: https://skia.googlesource.com/skia/+/27415b71bd529456165945e19b5b7efbebf6fb51 TBR=jvanverth@google.com NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/644823003
* Revert of Fix bug in plot locking system (patchset #3 id:80001 of ↵Gravatar robertphillips2014-10-09
| | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/640323002/) Reason for revert: Failing unit tests Original issue's description: > Fix bug in plot locking system > > In the new MultiPictureDraw tests a single hoisted layer is reused multiple times. The previous plot locking scheme allowed GrCachedLayer objects to be aggressively deleted prematurely leaving the reusing GrHoistedLayer objects with dangling pointers. > > This CL changes the plot locking system to add a pseudo-ref for each GrHoistedLayer. > > NOTRY=true > > Committed: https://skia.googlesource.com/skia/+/5c481666c9678f43e039ad605457be3854cf8de3 TBR=jvanverth@google.com NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/643673004
* Use BBH reserve hook to preallocate space for tiles.Gravatar mtklein2014-10-09
| | | | | | | | | | | | | | | | | | | | | Before getting too far into changing how SkTileGrid stores its tiles, I figured I'd better see how much I can tweak out the existing format. Cleverly, that way any improvements I make by changing the format will look that much less impressive. This CL looks like it will be a 5-15% win in time spent recording, with no effect on playback. This CL also shrinks the tiles to fit exactly when we're done inserting, using newly added SkTDArray::shrinkToFit(). It's quite cheap to run (maybe taking back 1-2% from those 5-15% wins), and means we'll lug around about 15% fewer bytes in the tile grids. Note though this strategy temporarily uses up to 30% more memory while building the tile grid. For our largest SKPs, that's maybe 75-100K extra. BUG=skia: Review URL: https://codereview.chromium.org/639823005
* Fix bug in plot locking systemGravatar robertphillips2014-10-09
| | | | | | | | | | In the new MultiPictureDraw tests a single hoisted layer is reused multiple times. The previous plot locking scheme allowed GrCachedLayer objects to be aggressively deleted prematurely leaving the reusing GrHoistedLayer objects with dangling pointers. This CL changes the plot locking system to add a pseudo-ref for each GrHoistedLayer. NOTRY=true Review URL: https://codereview.chromium.org/640323002
* Refactor GrLayerHoister::FindLayersToHoist to prep for adding clip to cache keyGravatar robertphillips2014-10-09
| | | | | | NOTRY=true Review URL: https://codereview.chromium.org/640373002
* Fix restore in AVMR to have correct coverage count.Gravatar egdaniel2014-10-09
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/638173003
* Small improvements to SkBitSet:Gravatar mtklein2014-10-09
| | | | | | | | | | - implement O(1) operations in SkBitSet.h so they can inline away - use calloc to allocate empty bitsets instead of malloc then clear - little style things BUG=skia: Review URL: https://codereview.chromium.org/640243003
* Improve SkARGB32_A8_BlitMask_SSE2Gravatar jmuizelaar2014-10-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With clang this: - movzbl -3(%rbx), %edx - pxor %xmm5, %xmm5 - pinsrw $0, %edx, %xmm5 - pinsrw $1, %edx, %xmm5 - movzbl -2(%rbx), %edx - pinsrw $2, %edx, %xmm5 - pinsrw $3, %edx, %xmm5 - movzbl -1(%rbx), %edx - pinsrw $4, %edx, %xmm5 - pinsrw $5, %edx, %xmm5 - movzbl (%rbx), %edx - pinsrw $6, %edx, %xmm5 - pinsrw $7, %edx, %xmm5 becomes: + movd (%rbx), %xmm4 + punpcklbw %xmm9, %xmm4 + punpcklwd %xmm4, %xmm4 And clang already does better codegen than msvc 2013 on this. BUG=skia: Review URL: https://codereview.chromium.org/609823003
* Remove tab parameter from GrGLSLMulVarBy4f functionGravatar egdaniel2014-10-09
| | | | | | | | | With pretty printing of shader code, there is no longer a need to explictily have tabs in our code. BUG=skia: Review URL: https://codereview.chromium.org/648463002
* Use presence of a content key as non-scratch indicatorGravatar bsalomon2014-10-09
| | | | | | | | BUG=skia:2889 Committed: https://skia.googlesource.com/skia/+/9eefe0851eeaa8ded05b4774ebcb38ed201d5dbf Review URL: https://codereview.chromium.org/639873002
* Leak fixedGravatar sugoi2014-10-09
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/639423002
* gl programs rewriteGravatar joshualitt2014-10-09
| | | | | | | | BUG=skia: Committed: https://skia.googlesource.com/skia/+/07a255310aca9f3e83bf741dc663a58818ad681c Review URL: https://codereview.chromium.org/628633003
* Add SkBBoxHierarchy::reserve() as an optional size hint.Gravatar mtklein2014-10-09
| | | | | | | | | | | | I want to play around with how SkTileGrid stores its tiles. Having a cap on the number of insert() calls can be pretty handy. While I'm at it, I gave flush() a default empty impl. Like reserve(), it's really an optional hook for subclasses. BUG=skia: Review URL: https://codereview.chromium.org/639933003
* Draw more accurate thick-stroked Beziers (disabled)Gravatar caryclark2014-10-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Draw thick-stroked Beziers by computing the outset quadratic, measuring the error, and subdividing until the error is within a predetermined limit. To try this CL out, change src/core/SkStroke.h:18 to #define QUAD_STROKE_APPROXIMATION 1 or from the command line: CPPFLAGS="-D QUAD_STROKE_APPROXIMATION=1" ./gyp_skia Here's what's in this CL: bench/BezierBench.cpp : a microbench for examining where the time is going gm/beziers.cpp : random Beziers with various thicknesses gm/smallarc.cpp : a distillation of bug skia:2769 samplecode/SampleRotateCircles.cpp : controls added for error, limit, width src/core/SkStroke.cpp : the new stroke implementation (disabled) tests/StrokerTest.cpp : a stroke torture test that checks normal and extreme values The new stroke algorithm has a tweakable parameter: stroker.setError(1); (SkStrokeRec.cpp:112) The stroke error is the allowable gap between the midpoint of the stroke quadratic and the center Bezier. As the projection from the quadratic approaches the endpoints, the error is decreased proportionally so that it is always inside the quadratic curve. An overview of how this works: - For a given T range of a Bezier, compute the perpendiculars and find the points outset and inset for some radius. - Construct tangents for the quadratic stroke. - If the tangent don't intersect between them (may happen with cubics), subdivide. - If the quadratic stroke end points are close (again, may happen with cubics), draw a line between them. - Compute the quadratic formed by the intersecting tangents. - If the midpoint of the quadratic is close to the midpoint of the Bezier perpendicular, return the quadratic. - If the end of the stroke at the Bezier midpoint doesn't intersect the quad's bounds, subdivide. - Find where the Bezier midpoint ray intersects the quadratic. - If the intersection is too close to the quad's endpoints, subdivide. - If the error is large proportional to the intersection's distance to the quad's endpoints, subdivide. BUG=skia:723,skia:2769 Review URL: https://codereview.chromium.org/558163005
* use real pdfdevice behind SkDocumentGravatar reed2014-10-09
| | | | | | | BUG=skia: TBR=bungeman@google.com Review URL: https://codereview.chromium.org/645563002
* Adding 3D lut color filterGravatar sugoi2014-10-09
| | | | | | | | Included in this cl is support for 3D textures. BUG=skia: Review URL: https://codereview.chromium.org/580863004
* Make the Sk GL context class an abstract base classGravatar kkinnunen2014-10-09
| | | | | | | | | | | | | | | | | | | | | | | Make the Sk GL context class, SkGLNativeContext, an abstract base class. Before, it depended on ifdefs to implement the platform dependent polymorphism. Move the logic to subclasses of the various platform implementations. This a step to enable Skia embedders to compile dm and bench_pictures. The concrete goal is to support running these test apps with Chromium command buffer. With this change, Chromium can implement its own version of SkGLNativeContext that uses command buffer, and host the implementation in its own repository. Implements the above by renaming the SkGLContextHelper to SkGLContext and removing the unneeded SkGLNativeContext. Also removes SkGLNativeContext::AutoRestoreContext functionality, it appeared to be unused: no use in Skia code, and no tests. BUG=skia:2992 Committed: https://skia.googlesource.com/skia/+/a90ed4e83897b45d6331ee4c54e1edd4054de9a8 Review URL: https://codereview.chromium.org/630843002
* Remove ~GrIORef since last remaining virtual and now all inlineGravatar bsalomon2014-10-08
| | | | | | | TBR=reed@google.com NOTRY=true Review URL: https://codereview.chromium.org/638003003
* Revert of Use presence of a content key as non-scratch indicator (patchset ↵Gravatar bsalomon2014-10-08
| | | | | | | | | | | | | | | | | | | | | #5 id:80001 of https://codereview.chromium.org/639873002/) Reason for revert: breaking nanobench on ubuntu Original issue's description: > Use presence of a content key as non-scratch indicator > > BUG=skia:2889 > > Committed: https://skia.googlesource.com/skia/+/9eefe0851eeaa8ded05b4774ebcb38ed201d5dbf TBR=robertphillips@google.com NOTREECHECKS=true NOTRY=true BUG=skia:2889 Review URL: https://codereview.chromium.org/642493003
* Use presence of a content key as non-scratch indicatorGravatar bsalomon2014-10-08
| | | | | | BUG=skia:2889 Review URL: https://codereview.chromium.org/639873002
* Rearrange code in TextContexts to be more consistent and match style guide.Gravatar jvanverth2014-10-08
| | | | Review URL: https://codereview.chromium.org/641613003
* GrResourceCache2 manages scratch texture.Gravatar bsalomon2014-10-08
| | | | | | BUG=skia:2889 Review URL: https://codereview.chromium.org/608883003
* Fix conditional check when copying coverage stages in ODSGravatar egdaniel2014-10-08
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/639773004
* Delay copying effects from DS or ODS till end of creating ODSGravatar egdaniel2014-10-08
| | | | | | | | Also delay the removal of fixed function VA's until so we only have to do a single removal step BUG=skia: Review URL: https://codereview.chromium.org/634073002
* Add SkCachedData and use it for SkMipMapGravatar reed2014-10-08
| | | | | | | | This reverts commit 37c5a815d8ea33247968212ef4cc83394ceee1bc. TBR=mtklein Review URL: https://codereview.chromium.org/635333002
* Expose layer hoisting API in GrContextGravatar robertphillips2014-10-08
| | | | | | This CL exposes the layer hoisting API in GrContext for use in SkMultiPictureDraw::draw. It basically mirrors what SkGpuDevice::EXPERIMENTAL_drawPicture has been doing. Review URL: https://codereview.chromium.org/533673002
* Revert of Make the Sk GL context class an abstract base class (patchset #4 ↵Gravatar bsalomon2014-10-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | id:60001 of https://codereview.chromium.org/630843002/) Reason for revert: nanobech failing on Android Original issue's description: > Make the Sk GL context class an abstract base class > > Make the Sk GL context class, SkGLNativeContext, an abstract base class. Before, > it depended on ifdefs to implement the platform dependent polymorphism. Move > the logic to subclasses of the various platform implementations. > > This a step to enable Skia embedders to compile dm and bench_pictures. The > concrete goal is to support running these test apps with Chromium command buffer. > > With this change, Chromium can implement its own version of SkGLNativeContext > that uses command buffer, and host the implementation in its own repository. > > Implements the above by renaming the SkGLContextHelper to SkGLContext and > removing the unneeded SkGLNativeContext. Also removes > SkGLNativeContext::AutoRestoreContext functionality, it appeared to be unused: > no use in Skia code, and no tests. > > BUG=skia:2992 > > Committed: https://skia.googlesource.com/skia/+/a90ed4e83897b45d6331ee4c54e1edd4054de9a8 TBR=kkinnunen@nvidia.com NOTREECHECKS=true NOTRY=true BUG=skia:2992 Review URL: https://codereview.chromium.org/639793002
* Revert of speculative fix for ios (patchset #1 id:1 of ↵Gravatar bsalomon2014-10-08
| | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/637293003/) Reason for revert: Need to revert a90ed4e83897b45d6331ee4c54e1edd4054de9a8 Original issue's description: > speculative fix for ios > > TBR= > > Committed: https://skia.googlesource.com/skia/+/96e89d5b45e8e293139ecd95302b5b4f07f8e9dc TBR= NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/636153002
* speculative fix for iosGravatar Brian Salomon2014-10-08
| | | | | | TBR= Review URL: https://codereview.chromium.org/637293003
* Make the Sk GL context class an abstract base classGravatar kkinnunen2014-10-08
| | | | | | | | | | | | | | | | | | | | | Make the Sk GL context class, SkGLNativeContext, an abstract base class. Before, it depended on ifdefs to implement the platform dependent polymorphism. Move the logic to subclasses of the various platform implementations. This a step to enable Skia embedders to compile dm and bench_pictures. The concrete goal is to support running these test apps with Chromium command buffer. With this change, Chromium can implement its own version of SkGLNativeContext that uses command buffer, and host the implementation in its own repository. Implements the above by renaming the SkGLContextHelper to SkGLContext and removing the unneeded SkGLNativeContext. Also removes SkGLNativeContext::AutoRestoreContext functionality, it appeared to be unused: no use in Skia code, and no tests. BUG=skia:2992 Review URL: https://codereview.chromium.org/630843002
* Cleanup of shader building systemGravatar joshualitt2014-10-07
| | | | | | | | | | | | | | | | | this is a huge refactor and cleanup of the gl shader building system in Skia. The entire shader building pipeline is now part of GrGLProgramCreator, which takes a gp, and some fps, and creates a program. I added some subclasses of GrGLProgram to handle the eccentricities of Nvpr/Nvpres. Outside of the builders folder and GrGLPrograms, this change is basically just a rename solo gp BUG=skia: Committed: https://skia.googlesource.com/skia/+/fe1233c3f12f81bb675718516bbb32f72af726ec Review URL: https://codereview.chromium.org/611653002
* Only use msaa target for blur mask when doAA is trueGravatar derekf2014-10-07
| | | | | | BUG=skia:2995 Review URL: https://codereview.chromium.org/639523002
* Revert of Cleanup of shader building system (patchset #25 id:470001 of ↵Gravatar joshualitt2014-10-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/611653002/) Reason for revert: Seems to have messed up windows 7 gms Original issue's description: > Cleanup of shader building system > > this is a huge refactor and cleanup of the gl shader building system in > Skia. The entire shader building pipeline is now part of > GrGLProgramCreator, which takes a gp, and some fps, and creates a > program. I added some subclasses of GrGLProgram to handle the > eccentricities of Nvpr/Nvpres. Outside of the builders folder > and GrGLPrograms, this change is basically just a rename > > > solo gp > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/fe1233c3f12f81bb675718516bbb32f72af726ec TBR=bsalomon@google.com NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/635533005
* Cleanup of shader building systemGravatar joshualitt2014-10-07
| | | | | | | | | | | | | | | this is a huge refactor and cleanup of the gl shader building system in Skia. The entire shader building pipeline is now part of GrGLProgramCreator, which takes a gp, and some fps, and creates a program. I added some subclasses of GrGLProgram to handle the eccentricities of Nvpr/Nvpres. Outside of the builders folder and GrGLPrograms, this change is basically just a rename solo gp BUG=skia: Review URL: https://codereview.chromium.org/611653002
* Revert "GrResourceCache2 manages scratch texture."Gravatar Brian Salomon2014-10-07
| | | | This reverts commit d14e1a27643125bfef37fa0ed314b64c1fae22b7.
* Stay in floats as much as possible in SkTileGrid, particularly in insert.Gravatar mtklein2014-10-07
| | | | | | | | | | | | | | SkTileGrid::insert() is about 15% of recording time before this CL, which reduces it to ~10%. Next steps are looking into some of the TODOs I've left myself, and vectorizing the math. Most of the win here comes from converting integer divisions into float multiplies. BUG=skia:1021 Review URL: https://codereview.chromium.org/615853007
* Add SkPaint::getHash().Gravatar mtklein2014-10-07
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/637583002
* Revert of gl programs rewrite (patchset #10 id:180001 of ↵Gravatar joshualitt2014-10-07
| | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/628633003/) Reason for revert: breaks angle bot Original issue's description: > gl programs rewrite > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/07a255310aca9f3e83bf741dc663a58818ad681c TBR=bsalomon@google.com,egdaniel@google.com NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/631183003
* gl programs rewriteGravatar joshualitt2014-10-07
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/628633003
* Fix for perspective GMs and df paths.Gravatar jvanverth2014-10-07
| | | | Review URL: https://codereview.chromium.org/636933003
* GrResourceCache2 manages scratch texture.Gravatar bsalomon2014-10-07
| | | | | | BUG=skia:2889 Review URL: https://codereview.chromium.org/608883003
* Make createOptDrawState return NULL if we would end up not drawingGravatar egdaniel2014-10-07
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/630063002