aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
Commit message (Collapse)AuthorAge
* Move lang to list in Android font manager.Gravatar Ben Wagner2017-08-14
| | | | | | | Change-Id: Ia4af2769f4761e6b444ed0c232c48199872f3acc Reviewed-on: https://skia-review.googlesource.com/33480 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Use kLow_SkFilterQuality in generateGlyphImageGravatar Robert Phillips2017-08-14
| | | | | | | | | This reduces jank when flinging a page of emoji on Android (I have separately shared out a spreadsheet). Arguably, the quality loss should be acceptable since we shouldn't be down-scaling that much (magnitude-wise not frequency-wise). Ideally, we would add a raster mode where we would draw at the correct size w/o generating the mip maps. Change-Id: Id91d638db1b2457567e54c264ed3fa5d10316976 Reviewed-on: https://skia-review.googlesource.com/33763 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* we never define BLEND_MODEGravatar Mike Klein2017-08-14
| | | | | | | | | Change-Id: I88f3e56971e9844ab2ff74edb0718e6b6e9c6559 Reviewed-on: https://skia-review.googlesource.com/34260 Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
* reduced number of string copies in SkSL parserGravatar Ethan Nicholas2017-08-14
| | | | | | | | Bug: skia: Change-Id: Iab823b01b6f5f85bbb47c4ac69c6ce396dabf497 Reviewed-on: https://skia-review.googlesource.com/34000 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
* Record SkCanvas::flush().Gravatar Mike Klein2017-08-14
| | | | | | | | | | We can record multiple frames in an .skp by recording SkCanvas::flush(). This should make SkPictures, SkLiteDL, and .skp files all record flush(). Change-Id: I6cf6e0e4ef993530d9f92fa168a53702ffce7d5e Reviewed-on: https://skia-review.googlesource.com/34081 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Fix tracing macros for framework buildsGravatar Brian Osman2017-08-14
| | | | | | | | Bug: skia: Change-Id: Ia5c27af2c8dafd5d6f2171fa82f435dbfdebd346 Reviewed-on: https://skia-review.googlesource.com/33760 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Simplify difference and exclusion.Gravatar Mike Klein2017-08-14
| | | | | | | | | | | | | | | | | | | | | | | We can fold through some math in these two modes. $ out/ok bench:samples=100 rp filter:search="Difference|Exclusion" serial Before: [blendmode_rect_Exclusion] 4.94ms @0 6.13ms @99 6.25ms @100 [blendmode_mask_Exclusion] 10.9ms @0 12.8ms @99 12.9ms @100 [blendmode_rect_Difference] 5.56ms @0 6.79ms @99 6.8ms @100 [blendmode_mask_Difference] 11.4ms @0 13.8ms @99 14.1ms @100 After: [blendmode_rect_Exclusion] 3.5ms @0 4.12ms @99 4.59ms @100 [blendmode_mask_Exclusion] 9.27ms @0 11.2ms @99 11.6ms @100 [blendmode_rect_Difference] 5.37ms @0 6.58ms @99 6.6ms @100 [blendmode_mask_Difference] 11ms @0 12.1ms @99 12.6ms @100 Change-Id: I03f32368244d4f979cfee83723fd78dfbc7d5fc1 Reviewed-on: https://skia-review.googlesource.com/33980 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org>
* lowp: lighten, difference, exclusionGravatar Florin Malita2017-08-14
| | | | | | | Change-Id: I5773cf831c7e41a932bee1f2c6830085fb7db025 Reviewed-on: https://skia-review.googlesource.com/33764 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@google.com>
* Guard lowp changesGravatar Florin Malita2017-08-11
| | | | | | | | | | Chromium uses the lowp code, we have to stage the changes. TBR= Change-Id: I45e97a51eca285c9afc71926bbf736a03d0d146c Reviewed-on: https://skia-review.googlesource.com/33765 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Lowp darken stageGravatar Florin Malita2017-08-11
| | | | | | | Change-Id: I4bf618ad8728541fcef3fc1c6aa5b3ca106d50dc Reviewed-on: https://skia-review.googlesource.com/33583 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Guard AA change to wait for rebaselinesGravatar Yuqian Li2017-08-11
| | | | | | | | | | | | | | We use SK_SUPPORT_LEGACY_DELTA_AA to guard the golden image change. Such flag is defined for Android, Chrome, and Google3 so our auto-rollers should all be OK. TBR: bungeman@google.com Bug: skia:6947 Change-Id: Ic2705e82f4f7f15ec08499254dce75b93d41727e Reviewed-on: https://skia-review.googlesource.com/33762 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Avoid converting drawImage/drawImageRect into drawBitmap callsGravatar Derek Sollenberger2017-08-11
| | | | | | | Change-Id: I1ae551afa93222126852bb9e429a565379a93f24 Reviewed-on: https://skia-review.googlesource.com/33661 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Derek Sollenberger <djsollen@google.com>
* Remove CHECK_SHOULD_DRAW from SkGpuDeviceGravatar Brian Salomon2017-08-11
| | | | | | | Change-Id: Ieb3910e2085235c62374d3e30d1ce6b9089de567 Reviewed-on: https://skia-review.googlesource.com/33780 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* SkSafeMath for tracking size_t overflowGravatar Herb Derby2017-08-11
| | | | | | | | | | | | | | Do multiply (mul) and add while tracking that the calculation does not overflow, which can be checked with ok(). The new unit test shows a couple examples. Author: Herb Derby <herb@google.com> Change-Id: I7e67671d2488d67f21d47d9618736a6bae8f23c3 Reviewed-on: https://skia-review.googlesource.com/33721 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Herb Derby <herb@google.com>
* Don't store clipped x which could break edge orderGravatar Yuqian Li2017-08-11
| | | | | | | | | | | | | | We only need to clip a temporary x to ensure that we don't blit beyond clip. Storing such clipped x is problematic because it may make our edges unsorted. The added unit test would fail without this fix. Bug: skia:6947 Change-Id: I6c21d7c7c097e50fef18ab151921d6c07c089318 Reviewed-on: https://skia-review.googlesource.com/33420 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* remove mask load() and store()Gravatar Mike Klein2017-08-11
| | | | | | | | | | | | | | | They appear to be slower than the generic load() and store() now. [blendmode_mask_Hue] 14.7ms @0 15.6ms @95 39.6ms @100 [blendmode_rect_Hue] 31.5ms @0 37.6ms @95 39.5ms @100 ~~> [blendmode_mask_Hue] 14.7ms @0 15.2ms @95 39.5ms @100 [blendmode_rect_Hue] 30.5ms @0 32.6ms @95 37.8ms @100 Change-Id: I674b75087b8139debead71f3016631bcb0cb0047 Reviewed-on: https://skia-review.googlesource.com/33800 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Replace log2 with SkNextLog2Gravatar Brian Osman2017-08-11
| | | | | | | | | | | log2 didn't exist on Android until API 18, and it's doing double precision math. I think this integer version is what we want? Bug: skia: Change-Id: I4909153c56a266688355349cda5d553b69f5c942 Reviewed-on: https://skia-review.googlesource.com/33680 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* double pump 8-bit stagesGravatar Mike Klein2017-08-11
| | | | | | | | | | | | | This basically unrolls all loops, handling twice as many pixels in a stride. We now pass around 4 native registers instead of just 2. I've temporarily disabled AVX2 mask loads and stores. It shouldn't be hard to turn them back on, but I'd want to test on AVX2 hardware first. Change-Id: I0907070f086a0650167456c149a479c1d96b8a2d Reviewed-on: https://skia-review.googlesource.com/33361 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Revert "Remove subpixel positioning implies no bytecode hinting."Gravatar Ben Wagner2017-08-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 880768032d7bd1528dc84f5b4408d4fa418bae7d. Reason for revert: Pixel tests, and gfx tests can't handle hinting. Original change's description: > Remove subpixel positioning implies no bytecode hinting. > > SkTypeface_FreeType::onFilterRec currently assumes that if we're asked > to do subpixel positioning, don't do bytecode hinting. The idea was that > both could not be satisfied at the same time, so pick something. This is > no longer true, as with the v40 interpreter it is possible to get > subpixel positioned but bytcode hinted glyphs. > > BUG=skia:6931 > > Change-Id: Ifaeff20c121d6bb4b9287f552e383547eb6d5d49 > Reviewed-on: https://skia-review.googlesource.com/32201 > Reviewed-by: Yuqian Li <liyuqian@google.com> > Reviewed-by: Ben Wagner <bungeman@google.com> > Commit-Queue: Ben Wagner <bungeman@google.com> TBR=bungeman@google.com,liyuqian@google.com,reed@google.com Change-Id: Idb1ee50d271846bdf962986914f6b75e3aa817c8 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:6931 Reviewed-on: https://skia-review.googlesource.com/33586 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Remove subpixel positioning implies no bytecode hinting.Gravatar Ben Wagner2017-08-11
| | | | | | | | | | | | | | | | SkTypeface_FreeType::onFilterRec currently assumes that if we're asked to do subpixel positioning, don't do bytecode hinting. The idea was that both could not be satisfied at the same time, so pick something. This is no longer true, as with the v40 interpreter it is possible to get subpixel positioned but bytcode hinted glyphs. BUG=skia:6931 Change-Id: Ifaeff20c121d6bb4b9287f552e383547eb6d5d49 Reviewed-on: https://skia-review.googlesource.com/32201 Reviewed-by: Yuqian Li <liyuqian@google.com> Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Much lower overhead Skia event tracing in the frameworkGravatar Brian Osman2017-08-11
| | | | | | | | Bug: skia: Change-Id: I0172e9e74898fb615cbb0ac61e46cbf9012ae75b Reviewed-on: https://skia-review.googlesource.com/33262 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Make GrFragmentProcessor be non-refcounted and use std::unique_ptr.Gravatar Brian Salomon2017-08-11
| | | | | | | Change-Id: I985e54a071338e99292a5aa2f42c92bc115b4008 Reviewed-on: https://skia-review.googlesource.com/32760 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Expose SkPath validation as booleanGravatar Adrienne Walker2017-08-10
| | | | | | | | | | | | | | | | As a part of serializing SkPaths, I want to be able to know (without asserting) whether or not a path is valid so that I can discard potentially malicious deserialized paths. Currently, SkPath(Ref) both just have asserting validation functions which can't be used externally. This patch adds accessors that don't assert. Bug: chromium:752755 skia:6955 Change-Id: I4d0ceb31ec660b87e3fda438392ad2b60a27a0da Reviewed-on: https://skia-review.googlesource.com/31720 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Reed <reed@google.com>
* Bypass libandroid dynamic linking for ATrace in framework buildsGravatar Brian Osman2017-08-10
| | | | | | | | | | | | | | | These symbols were resolving, but weren't really connected to systrace on Android. Using the macros/functions allows this to work correctly. This change doesn't actually cause anything to happen in framework builds - that still requires installing an instance of SkATrace, but now doing so will route all of Skia's TRACE_EVENT macros to systrace. Bug: skia: Change-Id: I6d2eafac7ef2531ba92094b92f68e59e0490ef62 Reviewed-on: https://skia-review.googlesource.com/33400 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Remove fStencilClearValue from Vulkan's CommandBufferInfo structGravatar Robert Phillips2017-08-10
| | | | | | | | | | | Adding this extra field to the CommandBufferInfo may or may not have led to a memory regression. Remove it until it is actually needed. Change-Id: Ibdddbeb7625f91f5199584a575289f07f6e95304 Reviewed-on: https://skia-review.googlesource.com/33280 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Hide GrPaint copy constructor and add GrPaint::Clone and remove MoveOrNew ↵Gravatar Brian Salomon2017-08-10
| | | | | | | | | | | and MoveOrCopy. Also makes paint clones use cloned fragment processors. Change-Id: I60efcfc6a46a4f8430a72f4d1ec79c7d99fbe593 Reviewed-on: https://skia-review.googlesource.com/33084 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Some performance tweaks for DAAGravatar Yuqian Li2017-08-10
| | | | | | | | | | | | | | | | | | | | | | | 1. Always inline (Clang previously ignored inline and got 25% slower) 2. SIMD everywhere other than x86 gcc: non-SIMD is only faster in my desktop with gcc; with Clang on my desktop, SIMD is 50% faster than non-SIMD. 3. Allocate 4x memory instead of 2x when running out of space: on old Android devices with Linux kernel 3.10 (e.g., Nexus 6P, 5X), the alloc/memcpy will triger a major bottleneck in kernel (30% of the running time). Such bottleneck goes away (the kernel is no longer doing stupid things during alloc/memcpy) in Linux kernel 3.18 (e.g., Pixel), and that's why DAA is much faster on Pixel than on Nexus 6P. I think maybe I should adopt SkRasterPipeline for device-specific optimizations. Bug: skia: Change-Id: I0408aa7671a5f1b39aad3bec25f8fc994ff5a1bb Reviewed-on: https://skia-review.googlesource.com/30820 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Revert "Revert "Support single line objects and arrays""Gravatar Brian Osman2017-08-10
| | | | | | | | | | This reverts commit a5a69cfb480b99747ddc272149d35c6302abf1bf. Bug: skia: Change-Id: I08475d96255b9df13e5c86e1ef9c7f4739e51459 Reviewed-on: https://skia-review.googlesource.com/33202 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Avoid errors about re-defining __STDC_FORMAT_MACROSGravatar Brian Osman2017-08-10
| | | | | | | | Bug: skia: Change-Id: I880e3d5a668743ac12fb0101baca637443e920b4 Reviewed-on: https://skia-review.googlesource.com/33082 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Revert "Revert "GrContext::dump that produces JSON formatted output""Gravatar Brian Osman2017-08-10
| | | | | | | | | | This reverts commit 0f450acd76fd58a2f7464f99869ed6afbfac303c. Bug: skia: Change-Id: I97428fbbc6d82bf8b186ec5fdbf1a939c00e4126 Reviewed-on: https://skia-review.googlesource.com/32726 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Replace interp() with clut_{3,4}D stages.Gravatar Mike Klein2017-08-10
| | | | | | | | | | | | | | | I tried to follow exactly the same strategy as a start. (Though I did fix the off-by-one dimensions.) It does rather look like we only need 3D and 4D now that I've looked at the call sites. Looks like about a 20% speedup. Change-Id: I8b1af64750ad1750716ee1ab0767e64591c7206a Reviewed-on: https://skia-review.googlesource.com/32842 Commit-Queue: Mike Klein <mtklein@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Move GrAppliedClip into GrPipelineGravatar Brian Salomon2017-08-10
| | | | | | | Change-Id: I522c2fd52bea9813baba7cdb3f11b63e7ab96b50 Reviewed-on: https://skia-review.googlesource.com/28861 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Remove accessRenderTarget calls in service of binding stencil bufferGravatar Robert Phillips2017-08-10
| | | | | | | Change-Id: Ifca6e21c619a0433ecf0b8699d92661f8c3068a8 Reviewed-on: https://skia-review.googlesource.com/31243 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* No chop at y extrema for cubicsGravatar Yuqian Li2017-08-09
| | | | | | | | | | | | | | | | | | The new Delta AA scan converter does not need the edge to be updated with monotonic Y so chopping at y extrema is not necessary. Removing such chopping brings ~10% performance increase to chalkboard.svg which has tons of small cubics (the same is true for many svgs I saw). We didn't remove the chopping for quads because that does not bring a significant speedup. Moreover, dropping those y extremas would make our strokecircle animation look a little more wobbly (because we would have fewer divisions for the quads at the top and bottom of the circle). Bug: skia: Change-Id: I3984d2619f9f77269ed24e8cbfa9f1429ebca4a8 Reviewed-on: https://skia-review.googlesource.com/31940 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Revert "GrContext::dump that produces JSON formatted output"Gravatar Brian Osman2017-08-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 175af0d01177fc6e5a81e979cd2ae3009c375940. Reason for revert: Chrome doesn't know about portable format specifiers. Sigh. Original change's description: > GrContext::dump that produces JSON formatted output > > Includes caps, GL strings, and extensions > > Bug: skia: > Change-Id: I1e8b3dd50fb68357f9de8ca6149cf65443d027ef > Reviewed-on: https://skia-review.googlesource.com/32340 > Commit-Queue: Brian Osman <brianosman@google.com> > Reviewed-by: Brian Salomon <bsalomon@google.com> TBR=bsalomon@google.com,brianosman@google.com Change-Id: Ie280b25275725f0661da7541f54ed62897abb82f No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/32861 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Revert "Support single line objects and arrays"Gravatar Brian Osman2017-08-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 6a7d56fa0f7009be9df36774774f3c337d7c7760. Reason for revert: Earlier commit needs to be reverted for Chrome roll. Original change's description: > Support single line objects and arrays > > This is just a formatting nicety. The new caps dump has several large > arrays of structs, and keeping each object on one line makes them much > more readable. (It also limits the total length of the output, which > helps when scanning through). > > Example of the output, before and after this change: > https://gist.github.com/brianosman/872f33be9af49031023b791e7db0b1fb > > Bug: skia: > Change-Id: I0fe0c2241b0c7f451b0837500e554d0491126d5e > Reviewed-on: https://skia-review.googlesource.com/32820 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Brian Osman <brianosman@google.com> TBR=bsalomon@google.com,brianosman@google.com Change-Id: I2b05cf79ca4804e5944f2eb3e17fe4be4d5af290 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/32860 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Move GrProcessorSet into GrPipelineGravatar Brian Salomon2017-08-09
| | | | | | | Change-Id: Ibfa5e1adda3c32140590aa62a31d35654cef79dd Reviewed-on: https://skia-review.googlesource.com/28187 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Remove SkColorLookUpTable::interp3D().Gravatar Mike Klein2017-08-09
| | | | | | | | | | It looks like our recursive approach is faster than interp3D(), and we'd prefer trilinear interpolation over tetrahedral for quality. Change-Id: I1019254b9ecf24b2f4feff17ed8ae1b48fcc281e Reviewed-on: https://skia-review.googlesource.com/32800 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Revert "Store discard request on the opList and remove GrDiscardOp"Gravatar Robert Phillips2017-08-09
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit b681a0f1b0acebe36130fd463d14016d48295b97. Reason for revert: Seems to be messing up some MacMini & Nexus7 bots Original change's description: > Store discard request on the opList and remove GrDiscardOp > > Change-Id: Ic1f76bb91c16b23df1fe71c07a4d5ad5abf1dc26 > Reviewed-on: https://skia-review.googlesource.com/32640 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Robert Phillips <robertphillips@google.com> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com Change-Id: I8a89fae7bb11791bd023d7444a074bb34d006fd0 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/32704 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Move gFDot6INVERSE definition to cpp fileGravatar Yuqian Li2017-08-09
| | | | | | | | Bug: skia:6946 Change-Id: Iee029a73ae899b0f73910b45c7cf83bd37dc07c3 Reviewed-on: https://skia-review.googlesource.com/32840 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Support single line objects and arraysGravatar Brian Osman2017-08-09
| | | | | | | | | | | | | | | | This is just a formatting nicety. The new caps dump has several large arrays of structs, and keeping each object on one line makes them much more readable. (It also limits the total length of the output, which helps when scanning through). Example of the output, before and after this change: https://gist.github.com/brianosman/872f33be9af49031023b791e7db0b1fb Bug: skia: Change-Id: I0fe0c2241b0c7f451b0837500e554d0491126d5e Reviewed-on: https://skia-review.googlesource.com/32820 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* GrContext::dump that produces JSON formatted outputGravatar Brian Osman2017-08-09
| | | | | | | | | | Includes caps, GL strings, and extensions Bug: skia: Change-Id: I1e8b3dd50fb68357f9de8ca6149cf65443d027ef Reviewed-on: https://skia-review.googlesource.com/32340 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* add gamma stageGravatar Mike Klein2017-08-09
| | | | | | | | | | | | | | | | Until now we've been using 3 separate parametric stages to apply gamma to r,g,b. That works fine, but is kind of unnecessarily slow, and again less clear in a stack trace than seeing "gamma". The new bench runs in about 60% of the time the old one does on my Trashcan. BUG=skia:6939 Change-Id: I079698d3009b081f1c23a2e27fc26e373b439610 Reviewed-on: https://skia-review.googlesource.com/32721 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Store discard request on the opList and remove GrDiscardOpGravatar Robert Phillips2017-08-09
| | | | | | | Change-Id: Ic1f76bb91c16b23df1fe71c07a4d5ad5abf1dc26 Reviewed-on: https://skia-review.googlesource.com/32640 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Improve float-based dither logicGravatar Eric Karl2017-08-09
| | | | | | | | | | | | | This code simulates the integer-based ordered-dither using step/mod with only floating point values. Produces similar results. R=bsalomon@google.com Bug: skia:4430 Change-Id: I1406f751f0ddd6bfd14e532dfb4efc0bb5784992 Reviewed-on: https://skia-review.googlesource.com/28942 Commit-Queue: Eric Karl <ericrk@chromium.org> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Fix stencil clear load in VulkanGravatar Robert Phillips2017-08-09
| | | | | | | | | | A later clear call was nuking the stencil clear load setting. Bug: skia:6936 Change-Id: Ib2c5cd930273cd6e613ca7191f8b7806abe6c218 Reviewed-on: https://skia-review.googlesource.com/32541 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Store GrRenderTarget in GrGpuCommandBufferGravatar Robert Phillips2017-08-09
| | | | | | | Change-Id: I545d53ffb5f9d450b87a360516b03bdd47232a70 Reviewed-on: https://skia-review.googlesource.com/32460 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Added SkJSONWriterGravatar Brian Osman2017-08-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a stand-alone helper class for writing properly structured JSON to an SkWStream. It currently solves two problems (although this CL only uses it in one context): 1) Performance. Writing out JSON this way is about 10x faster than using JSONCPP. For the large amounts of data generated by the tracing system, that's a big win. 2) Makes it easy to emit structured JSON from code that's not fully centralized. We'd like to spit out JSON that describes a GrContext, GrGpu, GrCaps, etc... Doing that with simple string manipulation is complex, and spreads this logic over all those functions. Using JSONCPP adds yet another (large) third party library dependency (that we only build into our own tools right now). This went through several revisions. I originally planned it as a stateful SkString wrapper, so the user could just build their JSON as a string. That's O(N^2), though, because SkString grows by a (small) constant amount. Even using a better growth strategy still means needing RAM for all the resulting text, which is usually pointless. This version has a constant memory cost, so writing huge amounts of JSON to disk (tracing a long DM run can emit 100's of MBs) doesn't stress resources. Bug: skia: Change-Id: Ia716524b246db0f97d332da60d2ce9903069e748 Reviewed-on: https://skia-review.googlesource.com/31204 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Add explicit clear of stencil buffer before opLists that use themGravatar Robert Phillips2017-08-08
| | | | | | | | Change-Id: I9e2468e1331c6593dbc6da3ad510f08d1c589e8d Reviewed-on: https://skia-review.googlesource.com/32041 Commit-Queue: Stan Iliev <stani@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* use rasterpipeline for images if matrix is >= scale+translateGravatar Mike Reed2017-08-08
| | | | | | | | | Bug: skia: Change-Id: I36112fe54c6f2d0965d0b88f0291d7ffe0902715 Reviewed-on: https://skia-review.googlesource.com/30480 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org>