Commit Graph

2126 Commits

Author SHA1 Message Date
mtklein
0bd57b2e1e SkVarAlloc::approxBytesAllocated()
This is what I was getting at on the other CL.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/f27f1bcce50c8f95aea8469684a70b70c9baee09

CQ_EXTRA_TRYBOTS=client.skia.android:Test-Android-Nexus5-Adreno330-Arm7-Release-Trybot

Review URL: https://codereview.chromium.org/730193003
2014-11-18 09:32:36 -08:00
mtklein
a06a953121 Prune SkRTree
- Propagate a bunch of constant parameters through.
  - Delete code that's not used when bulk loading.
  - Allocate all Nodes together.
  - Stay in SkRect.

Doing a single malloc for the nodes can't not have improved memory usage.

Looks like this might improve record performance ~5%, probably mostly from
staying in SkRects.  This finally dethrones building the BBH as the hot spot.
(Now it's mapping user bounds back to device bounds and adjusting for paints.)

Recording time changes from my MBP:
    desk_rectangletransition.skp	11.5us -> 11.7us	1x
             desk_forecastio.skp	 115us ->  114us	0.98x
                desk_booking.skp	 550us ->  541us	0.98x
            tabl_mercurynews.skp	 176us ->  173us	0.98x
                   tabl_hsfi.skp	 294us ->  287us	0.98x
              desk_wordpress.skp	 351us ->  343us	0.98x
           tabl_worldjournal.skp	 439us ->  426us	0.97x
                  tabl_gmail.skp	20.3us -> 19.7us	0.97x
         desk_youtubetvvideo.skp	10.8us -> 10.4us	0.97x
             desk_googleplus.skp	 1.1ms -> 1.07ms	0.97x
               tabl_slashdot.skp	 106us ->  103us	0.97x
         desk_jsfiddlebigcar.skp	26.7us -> 25.7us	0.96x
               tabl_techmeme.skp	95.4us -> 91.7us	0.96x
             tabl_deviantart.skp	 133us ->  127us	0.96x
              desk_pinterest.skp	40.6us -> 38.9us	0.96x
                 desk_carsvg.skp	 195us ->  187us	0.96x
               tabl_engadget.skp	 376us ->  359us	0.96x
                tabl_sahadan.skp	60.5us -> 57.5us	0.95x
      tabl_culturalsolutions.skp	 255us ->  242us	0.95x
                  tabl_gspro.skp	58.3us -> 55.5us	0.95x
               desk_linkedin.skp	 146us ->  138us	0.94x
                   desk_ebay.skp	 192us ->  181us	0.94x
                    tabl_cnn.skp	 467us ->  440us	0.94x
     desk_jsfiddlehumperclip.skp	29.9us -> 28.1us	0.94x
               desk_tigersvg.skp	43.2us -> 40.5us	0.94x
           desk_yahooanswers.skp	 131us ->  123us	0.94x
desk_googlespreadsheetdashed.skp	1.18ms -> 1.11ms	0.94x
                desk_blogger.skp	 193us ->  181us	0.94x
                tabl_mozilla.skp	1.82ms ->  1.7ms	0.94x
                    tabl_mlb.skp	 145us ->  136us	0.93x
              mobi_wikipedia.skp	 577us ->  539us	0.93x
               tabl_frantzen.skp	54.1us -> 50.4us	0.93x
                  desk_baidu.skp	87.9us -> 81.9us	0.93x
             desk_techcrunch.skp	 224us ->  209us	0.93x
                 desk_sfgate.skp	 206us ->  192us	0.93x
                  tabl_ukwsj.skp	 269us ->  250us	0.93x
               desk_facebook.skp	 316us ->  293us	0.93x
            desk_gmailthread.skp	 205us ->  190us	0.93x
         tabl_googlecalendar.skp	 158us ->  147us	0.93x
                   tabl_digg.skp	 382us ->  354us	0.93x
                 desk_amazon.skp	 106us -> 98.5us	0.93x
          tabl_androidpolice.skp	 693us ->  642us	0.93x
                tabl_nytimes.skp	 206us ->  191us	0.92x
                    desk_gws.skp	 124us ->  114us	0.92x
                desk_youtube.skp	 255us ->  235us	0.92x
           tabl_cuteoverload.skp	 583us ->  537us	0.92x
            desk_oldinboxapp.skp	  18us -> 16.6us	0.92x
             desk_mobilenews.skp	 297us ->  273us	0.92x
                 tabl_pravda.skp	 168us ->  154us	0.92x
              tabl_vnexpress.skp	 236us ->  217us	0.92x
          desk_css3gradients.skp	 202us ->  185us	0.92x
            tabl_gamedeksiam.skp	 508us ->  464us	0.91x
                desk_wowwiki.skp	1.02ms ->  929us	0.91x
                   desk_espn.skp	 209us ->  191us	0.91x
             desk_chalkboard.skp	 315us ->  284us	0.9x
                 desk_mapsvg.skp	 607us ->  543us	0.89x
            desk_pokemonwiki.skp	5.18ms -> 4.62ms	0.89x
               desk_samoasvg.skp	 335us ->  298us	0.89x
        desk_youtubetvbrowse.skp	10.1us -> 8.59us	0.85x
BUG=skia:3085, skia:2834

Review URL: https://codereview.chromium.org/734723002
2014-11-18 09:27:49 -08:00
mtklein
52b7822fa6 Revert of SkVarAlloc::approxBytesAllocated (patchset #5 id:80001 of https://codereview.chromium.org/730193003/)
Reason for revert:
Android needs dlmalloc_usable_size().

Original issue's description:
> SkVarAlloc::approxBytesAllocated()
>
> This is what I was getting at on the other CL.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/f27f1bcce50c8f95aea8469684a70b70c9baee09
>
> CQ_EXTRA_TRYBOTS=Test-Android-Nexus5-Adreno330-Arm7-Release-Trybot

TBR=reed@google.com,mtklein@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/741443002
2014-11-18 08:15:23 -08:00
mtklein
f27f1bcce5 SkVarAlloc::approxBytesAllocated()
This is what I was getting at on the other CL.

BUG=skia:

Review URL: https://codereview.chromium.org/730193003
2014-11-18 07:24:14 -08:00
joshualitt
9853ccef19 Drawstate on stack
BUG=skia:

Review URL: https://codereview.chromium.org/732693002
2014-11-17 14:22:49 -08:00
robertphillips
f52a063dfd Fix yet another convexicator issue
This CL fixes the case where a bad initial vector (i.e., nearly zero) managed to short circuit all of the convexicator's logic. The initial bad vector would become the last vector and then never get displaced.

The history of this is:

https://codereview.chromium.org/298973004/
Switched the convexicator to not advance the last vector when the cross product wasn't significant

https://codereview.chromium.org/573763002/
Fixed a bug (crbug.com/412640) wherein a zero area path was being incorrectly categorized as convex b.c. opposite but equal vectors were not signaling concavity.

BUG=433683

Review URL: https://codereview.chromium.org/727283003
2014-11-17 12:11:42 -08:00
bsalomon
84c8e62fad Allow GPU resources to not be counted against the cache budget.
BUG=skia:2889

Review URL: https://codereview.chromium.org/721353002
2014-11-17 09:33:27 -08:00
bsalomon
dace19ec17 Correct accounting for wrapped resources
BUG=skia:2889

Review URL: https://codereview.chromium.org/720033004
2014-11-17 07:34:06 -08:00
reed
73c2501120 separate c headers
BUG=skia:

Review URL: https://codereview.chromium.org/728323002
2014-11-17 06:15:42 -08:00
joshualitt
5478d427c6 Push creation of default GP to the caller
TBR=
BUG=skia:

Review URL: https://codereview.chromium.org/715903002
2014-11-14 16:00:38 -08:00
scroggo
28562a0199 Fix Android framework build.
When we define SK_BUILD_FOR_ANDROID, we don't define it to anything,
so

    #if SK_BUILD_FOR_ANDROID

is not a meaningful check. Instead, use #ifdef.

TBR=caryclark@google.com, djsollen@google.com

Review URL: https://codereview.chromium.org/728013002
2014-11-14 14:49:34 -08:00
bsalomon
12299ab7a1 Make GrResourceCache2 responsible for calling release, abandon, and ~.
BUG=skia:2889

TBR=robertphillips@google.com

NOTRY=true

Review URL: https://codereview.chromium.org/729683002
2014-11-14 13:33:09 -08:00
bsalomon
71cb0c241e Replace GrResourceCache with GrResourceCache2.
BUG=skia:2889

Committed: https://skia.googlesource.com/skia/+/66a450f21a3da174b7eed89a1d5fc8591e8b6ee6

Committed: https://skia.googlesource.com/skia/+/407aa584d183c1bf314f5defd1cf0202e8a96c89

Review URL: https://codereview.chromium.org/716143004
2014-11-14 12:10:15 -08:00
mtklein
d4897591fd Don't pass null to memcmp.
This will allow us to add nonnull-attribute to the UBSAN bot.

We are in fact hitting a case where one of the arguments is null and the other
not, which seems dicey.  I think the scenario is comparing the empty pathref
with another path ref that's just been COWed, without any verbs or points yet.

BUG=skia:

Review URL: https://codereview.chromium.org/732643002
2014-11-14 09:22:40 -08:00
bsalomon
ac49acda52 Revert of Replace GrResourceCache with GrResourceCache2. (patchset #7 id:120001 of https://codereview.chromium.org/716143004/)
Reason for revert:
broken again

Original issue's description:
> Replace GrResourceCache with GrResourceCache2.
>
> BUG=skia:2889
>
> Committed: https://skia.googlesource.com/skia/+/66a450f21a3da174b7eed89a1d5fc8591e8b6ee6
>
> Committed: https://skia.googlesource.com/skia/+/407aa584d183c1bf314f5defd1cf0202e8a96c89

TBR=robertphillips@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:2889

Review URL: https://codereview.chromium.org/726913002
2014-11-14 06:47:39 -08:00
bsalomon
407aa584d1 Replace GrResourceCache with GrResourceCache2.
BUG=skia:2889

Committed: https://skia.googlesource.com/skia/+/66a450f21a3da174b7eed89a1d5fc8591e8b6ee6

Review URL: https://codereview.chromium.org/716143004
2014-11-14 06:29:40 -08:00
reed
d54d3fc824 remove unused kLCD_MaskFormat
BUG=skia:

Review URL: https://codereview.chromium.org/728673002
2014-11-13 14:39:58 -08:00
bsalomon
f21dab9540 Revert of Replace GrResourceCache with GrResourceCache2. (patchset #6 id:100001 of https://codereview.chromium.org/716143004/)
Reason for revert:
Breaking stuff

Original issue's description:
> Replace GrResourceCache with GrResourceCache2.
>
> BUG=skia:2889
>
> Committed: https://skia.googlesource.com/skia/+/66a450f21a3da174b7eed89a1d5fc8591e8b6ee6

TBR=robertphillips@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:2889

Review URL: https://codereview.chromium.org/715333003
2014-11-13 13:33:28 -08:00
bsalomon
66a450f21a Replace GrResourceCache with GrResourceCache2.
BUG=skia:2889

Review URL: https://codereview.chromium.org/716143004
2014-11-13 13:19:10 -08:00
mtklein
f2950b1c45 Deparameterize SkVarAlloc.
SkRecord performance is not sensitive to these values, so we can cut some
storage.  This rearranges the space-remaining logic to use a count of bytes
left rather than a pointer to the end, cutting memory usage a little more.

An SkVarAlloc used to weigh 20 or 32 bytes which now becomes 16 or 24.

I think if I think about it a bit more I can trim off that Block* too,
getting us to 12 or 16 bytes.

Because we now just always grow by doubling, this CL switches from storing
fSmallest to its log base 2.  This has the nice effect of never having to worry
about it overflowing, and means we can probably squeeze it down into a byte
if we want, even 6 bits.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/bc415389855888af5a1282ca4b6bee30afa3d69d

CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu12-ShuttleA-GTX660-x86-Debug-Trybot

Review URL: https://codereview.chromium.org/721313002
2014-11-13 12:41:14 -08:00
caryclark
912c9ec6ee disable a couple of new fuzz378 tests on android
these tests fail on a nexus 9 in release only. It's probably related
to the fused multiply-add instruction

TBR=

Review URL: https://codereview.chromium.org/722303002
2014-11-13 11:08:52 -08:00
caryclark
65f553182a These tests stress pathops by describing the union of circle-like paths that have tiny line segments embedded and double back to create near-coincident conditions.
The fixes include
- detect when finding the active top loops between two possible answers
- preflight chasing winding to ensure answer is consistent
- binary search more often when quadratic intersection fails
- add more failure paths when an intersect is missed

While this fixes the chrome bug, reenabling path ops in svg should be deferred until additional fixes are landed.

TBR=
BUG=421132

Committed: https://skia.googlesource.com/skia/+/6f726addf3178b01949bb389ef83cf14a1d7b6b2

Review URL: https://codereview.chromium.org/633393002
2014-11-13 06:58:52 -08:00
bsalomon
69ed47f42d Make GrGpuResource::gpuMemorySize non-virtual w/ onGpuMemorySize virtual impl
BUG=skia:2889

Review URL: https://codereview.chromium.org/702413003
2014-11-12 11:13:39 -08:00
mtklein
703d3c7093 Followup: remove unnecessary SkTRefArray
BUG=skia:

Review URL: https://codereview.chromium.org/719113004
2014-11-12 11:08:20 -08:00
bsalomon
48ea202817 set key data in duplicate scratch key unit test
TBR=robertphillips@google.com

Review URL: https://codereview.chromium.org/722763002
2014-11-12 10:28:17 -08:00
mtklein
391e318b3d Fix memory leak in BitmapHeapTest
BUG=skia:

Review URL: https://codereview.chromium.org/715383003
2014-11-12 10:09:11 -08:00
mtklein
88300a555f Follow up.
BUG=skia:

Review URL: https://codereview.chromium.org/719853002
2014-11-12 09:38:21 -08:00
robertphillips
8236591547 Rename GrAccelData to SkLayerInfo and move it to src/core
Review URL: https://codereview.chromium.org/719133002
2014-11-12 09:32:34 -08:00
mtklein
a74ce853c8 Start stripping out complicated parts of SkPicture{Record,Data}.
First step: no more paint flattening or deduplication.

BUG=skia:

Review URL: https://codereview.chromium.org/723593002
2014-11-12 09:19:02 -08:00
egdaniel
605dd0fbce Move GrInvariantOutput out of GrProcessor and into its own class.
This will help with the ability to subclass, add to, etc. GrInvariantOutput. Also it was simply
getting a little too big to be a "supporting" subclass
BUG=skia:

Review URL: https://codereview.chromium.org/699943003
2014-11-12 08:35:25 -08:00
mtklein
ef09991255 Add more tests.
BUG=skia:

Review URL: https://codereview.chromium.org/717143003
2014-11-12 07:27:01 -08:00
robertphillips
4e8e3421aa Move SkRecordComputeLayers and CollectLayers into SkRecordDraw.cpp
Rather then exposing parts of FillBounds (as in Expose FillBounds to allow GrPictureUtils::CollectLayers to be layered on top of it - https://codereview.chromium.org/698643002/), this CL moves CollectLayers into SkRecordDraw.cpp to accomplish the layering.

Review URL: https://codereview.chromium.org/716913003
2014-11-12 06:46:08 -08:00
mtklein
ad8aa1dcf3 Clang incorrectly thinks this typedef is unused.
BUG=skia:3059

Review URL: https://codereview.chromium.org/715093003
2014-11-11 18:52:02 -08:00
bsalomon
453cf40ac7 Add GrGpuResource::CacheAccess
Internal only helper class for manipulating and accessing cache keys.

BUG=skia:2889

Review URL: https://codereview.chromium.org/703303003
2014-11-11 14:15:57 -08:00
reed
f539b8cdee modify nothingToDraw to notice filters
This reverts commit c71ffd4e76.

TBR=

Review URL: https://codereview.chromium.org/683003003
2014-11-11 12:51:33 -08:00
mtklein
c71ffd4e76 Revert of modify nothingToDraw to notice filters (patchset #1 id:1 of https://codereview.chromium.org/717753002/)
Reason for revert:
modecolorfilters, perhaps more changed

Original issue's description:
> modify nothingToDraw to notice filters
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/d5688c509293a450c058e0cc1f4673be2931bb5c

TBR=djsollen@google.com,reed@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/717813002
2014-11-11 12:13:16 -08:00
reed
d5688c5092 modify nothingToDraw to notice filters
BUG=skia:

Review URL: https://codereview.chromium.org/717753002
2014-11-11 11:00:55 -08:00
bsalomon
6d4488c5e0 Remove all knowledge of resource keys from the legacy cache.
BUG=skia:2889

Review URL: https://codereview.chromium.org/705413002
2014-11-11 07:27:16 -08:00
mtklein
5da116f920 start again on Sk4x with portable version and unit tests
work on tests

CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu13.10-GCE-NoGPU-x86_64-Debug-ASAN-Trybot,Test-Ubuntu12-ShuttleA-GTX660-x86-Debug-Trybot,Test-Win7-ShuttleA-HD2000-x86_64-Debug-Trybot,Test-Win7-ShuttleA-HD2000-x86-Debug-Trybot
BUG=skia:

Review URL: https://codereview.chromium.org/704923003
2014-11-11 06:16:42 -08:00
robertphillips
81f71b6630 Change where layer hoisting data is gathered
This CL:
1) removes the EXPERIMENTAL_optimize on SkCanvas & SkDevice
2) moves the saveLayer gathering step to endRecording
3) Replaces GPUOptimize with SkRecordComputeLayers
4) Update bench_pictures & render_pictures to provide the new flag

#2 also necessitated moving the BBH computation (and record optimization) out of SkPicture's ctor (and into endRecording)

Review URL: https://codereview.chromium.org/718443002
2014-11-11 04:54:49 -08:00
halcanary
ac6c4fc524 tests/Time.cpp: more verbose errors
Review URL: https://codereview.chromium.org/711143002
2014-11-10 14:39:24 -08:00
scroggo
b61e206138 Add tests (and fix!) for known bad ICO files.
We previously saw crashes decoding bad ICO files. Add tests for
known bad files.

While testing, I learned that one of them still crashes. Check for
large offset and size separately to fix the crash.

BUG=skia:2878

Review URL: https://codereview.chromium.org/712123002
2014-11-10 13:12:25 -08:00
bsalomon
8b79d23f82 Use GrResourceCache2 to service content key lookups
BUG=skia:2889

Review URL: https://codereview.chromium.org/707493002
2014-11-10 10:19:06 -08:00
halcanary
8e74b1565c Fix SkTime::GetDateTime Posix implementation, add unit test.
The year was off by 1900

Review URL: https://codereview.chromium.org/714633002
2014-11-10 09:20:22 -08:00
reed
7c74885e01 flag imageinfo as srgb
intended uses:
- flag a SkSurface as sRGB (only supported by Ganesh for now)
- flag images (e.g. png or jpeg) as sRGB if the codec tells us that

wins:
- faster gamma-correct text (esp. w/ distance-fields) when we can use sRGB for text
- better color fidelity when the screen really is sRGB

Review URL: https://codereview.chromium.org/676883003
2014-11-10 08:57:21 -08:00
tfarina
a71d3af100 Cleanup: Use SkAutoGraphics in gm and tests.
BUG=None
R=bsalomon@google.com

Review URL: https://codereview.chromium.org/704413002
2014-11-07 06:12:30 -08:00
scroggo
0ee2627026 When running DM, write test failures to json.
Add skiatest::Failure to keep track of data about a test failure.

Reporter::reportFailed and ::onReportFailed now take Failure as a
parameter. This allows the implementation to treat the failure as it
wishes. Provide a helper to format the failure the same as prior to
the change.

Update the macros for calling reportFailed (REPORTER_ASSERT etc) to
create a Failure object.

Convert a direct call to reportFailed to the macro ERRORF.

Write Failures to Json.
Sample output when running dm on the dummy test crrev.com/705723004:
{
   "test_results" : {
      "failures" : [
         {
            "condition" : "0 > 3",
            "file_name" : "../../tests/DummyTest.cpp",
            "line_no" : 10,
            "message" : ""
         },
         {
            "condition" : "false",
            "file_name" : "../../tests/DummyTest.cpp",
            "line_no" : 4,
            "message" : ""
         },
         {
            "condition" : "1 == 3",
            "file_name" : "../../tests/DummyTest.cpp",
            "line_no" : 5,
            "message" : "I can too count!"
         },
         {
            "condition" : "",
            "file_name" : "../../tests/DummyTest.cpp",
            "line_no" : 6,
            "message" : "seven is 7"
         },
         {
            "condition" : "1 == 3",
            "file_name" : "../../tests/DummyTest.cpp",
            "line_no" : 14,
            "message" : "I can too count!"
         }
      ]
   }
}

Report all of the failures from one test.
Previously, if one test had multiple failures, only one was reportered.
e.g:

Failures:
  test Dummy: ../../tests/DummyTest.cpp:6   seven is 7
  test Dummy2: ../../tests/DummyTest.cpp:10 0 > 3
  test Dummy3: ../../tests/DummyTest.cpp:14 I can too count!: 1 == 3
3 failures.

Now, we get all the messages:

Failures:
  test Dummy: ../../tests/DummyTest.cpp:4   false
        ../../tests/DummyTest.cpp:5 I can too count!: 1 == 3
        ../../tests/DummyTest.cpp:6 seven is 7
  test Dummy2: ../../tests/DummyTest.cpp:10 0 > 3
  test Dummy3: ../../tests/DummyTest.cpp:14 I can too count!: 1 == 3
3 failures.

(Note that we still state "3 failures" because 3 DM::Tasks failed.)

BUG=skia:3082
BUG=skia:2454

Review URL: https://codereview.chromium.org/694703005
2014-11-07 06:07:32 -08:00
joshualitt
2c93efeb6f Clip in grdrawtarget
NOTREECHECKS=true
BUG=skia:

Review URL: https://codereview.chromium.org/685883003
2014-11-06 12:57:13 -08:00
bsalomon
3343557421 Add mock context and use in ResourceCacheTest.
BUG=skia:2889

Committed: https://skia.googlesource.com/skia/+/820dd6c335411aad889c1d7e8a857642ecd87e30

Review URL: https://codereview.chromium.org/702083003
2014-11-05 14:47:42 -08:00
bsalomon
fdcf2c0863 Revert of Add mock context and use in ResourceCacheTest. (patchset #4 id:60001 of https://codereview.chromium.org/702083003/)
Reason for revert:
Breaking tests

Original issue's description:
> Add mock context and use in ResourceCacheTest.
>
> BUG=skia:2889
>
> Committed: https://skia.googlesource.com/skia/+/820dd6c335411aad889c1d7e8a857642ecd87e30

TBR=robertphillips@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:2889

Review URL: https://codereview.chromium.org/704563004
2014-11-05 12:30:32 -08:00