Commit Graph

3104 Commits

Author SHA1 Message Date
benjaminwagner
0b2a189221 Fix code that left shifts a negative value. This has undefined behavior.
Patched from internal cl/107515669 by rtrieu and added comments.

BUG=skia:2481

Review URL: https://codereview.chromium.org/1439483002
2015-11-11 08:46:34 -08:00
msarett
5c351f38fa Delete dead SkImageDecoder::buildTileIndex and decodeSubset code
This approach to subset decoding is no longer supported.
We have replaced it with an implementation that does not
depend on forked libraries.
https://codereview.chromium.org/1406153015/

BUG=skia:

Review URL: https://codereview.chromium.org/1426943009
2015-11-10 15:38:23 -08:00
mtklein
cd49541524 For non-opaque SkBitmapDevices, replace malloc-then-zero with calloc.
There seem about a zillion possible ways to slice this.
This adds and uses SkMallocPixelRef::ZeroedPRFactory.
I'm not married to it.

This appears to clear up a hot spot in the benchmark referenced in this bug:
BUG=516426
I'm not confident enough on Windows to declare that definitively yet.

It probably helps all other non-opaque layers too.  Possibly significantly.

So I don't forget, I profiled this:
out/Release/performance_browser_tests.exe  --gtest_filter=TabCapturePerformanceTest.Performance/2 --single-process

No diffs:
https://gold.skia.org/search2?issue=1430593007&unt=true&query=source_type%3Dgm&master=false

TBR=reed@google.com

Review URL: https://codereview.chromium.org/1430593007
2015-11-05 09:46:23 -08:00
benjaminwagner
8a3760f8b2 For BUILD.public, let SkPreConfig.h set SK_RELEASE based on NDEBUG.
Use DumpStackTrace in SkASSERT in GOOGLE3.

There are extra assertions enabled in debug mode that cause RecordDraw_TextBounds to fail.

New include causes a naming conflict with global name "base".

Corresponding internal cl/106495354

No public API changes.

TBR=reed@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1423013004
2015-10-29 13:40:28 -07:00
pkasting
129319ff55 Attempt to update Xfermode comments to have parallel structure.
BUG=none
TEST=none

Review URL: https://codereview.chromium.org/1406413003
2015-10-29 08:41:15 -07:00
senorblanco
4449398b32 Make SkImageFilter::applyCropRect() optionally compute srcBounds.
BUG=skia:4526

Review URL: https://codereview.chromium.org/1410553007
2015-10-28 14:17:17 -07:00
mtklein
72815e9b15 move reinterpret_cast into SK_PREFETCH
no public API changes
TBR=reed@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/1419573011
2015-10-28 09:52:20 -07:00
halcanary
337797580d Make SkTextBlob::RunIterator public.
Motivation: This will be easier than adding a friend every time I want
to create a one-off SkCanvas subclass or SkRemote::Encoder subclass.

See also: SkPath::Iter.

Review URL: https://codereview.chromium.org/1411723005
2015-10-27 14:01:05 -07:00
mtklein
6885a1e7c0 Make SK_PREFETCH work on Windows too.
- Use _mm_prefetch() if available, e.g. with MSVC.
- Some other tidying up.

No public API changes.
TBR=reed@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/1427663002
2015-10-27 13:06:47 -07:00
bsalomon
19e82e3b9f Update SrcRectConstraint doc. Previous doc never matched the implementation or the c2d spec.
Review URL: https://codereview.chromium.org/1411103003
2015-10-23 09:27:42 -07:00
mtklein
33eefcd58b SkTime::GetNSecs()
- Move high-precision wall timers from tools/timer to SkTime.
   - Implement SkTime::GetMSecs() in terms of SkTime::GetNSecs().
   - Delete unused tools/timer code.

I have no idea what's going on there in src/animator.
I don't intend to investigate.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/70084cbc16ee8162649f2601377feb6e49de0217

CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot

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

Committed: https://skia.googlesource.com/skia/+/38a88e4c0c28a7be981aac7bb4a198ad95a62a63

Review URL: https://codereview.chromium.org/1422513003
2015-10-23 07:02:06 -07:00
mtklein
3b5b784542 Revert of SkTime::GetNSecs() (patchset #11 id:200001 of https://codereview.chromium.org/1422513003/ )
Reason for revert:
Times don't look like they make sense on Windows.

Original issue's description:
> SkTime::GetNSecs()
>
>    - Move high-precision wall timers from tools/timer to SkTime.
>    - Implement SkTime::GetMSecs() in terms of SkTime::GetNSecs().
>    - Delete unused tools/timer code.
>
> I have no idea what's going on there in src/animator.
> I don't intend to investigate.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/70084cbc16ee8162649f2601377feb6e49de0217
>
> CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/a1840d50e29fd95e4df2d1168fe54c34c2a5c30c
>
> Committed: https://skia.googlesource.com/skia/+/38a88e4c0c28a7be981aac7bb4a198ad95a62a63

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

Review URL: https://codereview.chromium.org/1422623003
2015-10-23 06:40:33 -07:00
mtklein
38a88e4c0c SkTime::GetNSecs()
- Move high-precision wall timers from tools/timer to SkTime.
   - Implement SkTime::GetMSecs() in terms of SkTime::GetNSecs().
   - Delete unused tools/timer code.

I have no idea what's going on there in src/animator.
I don't intend to investigate.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/70084cbc16ee8162649f2601377feb6e49de0217

CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot

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

Review URL: https://codereview.chromium.org/1422513003
2015-10-23 06:24:07 -07:00
mtklein
5a06df4686 Revert of SkTime::GetNSecs() (patchset #10 id:180001 of https://codereview.chromium.org/1422513003/ )
Reason for revert:
https://codereview.chromium.org/1412453006

Original issue's description:
> SkTime::GetNSecs()
>
>    - Move high-precision wall timers from tools/timer to SkTime.
>    - Implement SkTime::GetMSecs() in terms of SkTime::GetNSecs().
>    - Delete unused tools/timer code.
>
> I have no idea what's going on there in src/animator.
> I don't intend to investigate.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/70084cbc16ee8162649f2601377feb6e49de0217
>
> CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/a1840d50e29fd95e4df2d1168fe54c34c2a5c30c

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

Review URL: https://codereview.chromium.org/1417753003
2015-10-22 17:49:22 -07:00
mtklein
a1840d50e2 SkTime::GetNSecs()
- Move high-precision wall timers from tools/timer to SkTime.
   - Implement SkTime::GetMSecs() in terms of SkTime::GetNSecs().
   - Delete unused tools/timer code.

I have no idea what's going on there in src/animator.
I don't intend to investigate.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/70084cbc16ee8162649f2601377feb6e49de0217

CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot

Review URL: https://codereview.chromium.org/1422513003
2015-10-22 13:33:22 -07:00
reed
c9b5f8b152 tunnel down texture-size-constraint to imagefilters
BUG=skia:

Review URL: https://codereview.chromium.org/1421493003
2015-10-22 13:20:20 -07:00
caryclark
6ae30fbbaf Revert of SkTime::GetNSecs() (patchset #9 id:160001 of https://codereview.chromium.org/1422513003/ )
Reason for revert:
broke chromeos

Original issue's description:
> SkTime::GetNSecs()
>
>    - Move high-precision wall timers from tools/timer to SkTime.
>    - Implement SkTime::GetMSecs() in terms of SkTime::GetNSecs().
>    - Delete unused tools/timer code.
>
> I have no idea what's going on there in src/animator.
> I don't intend to investigate.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/70084cbc16ee8162649f2601377feb6e49de0217

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

Review URL: https://codereview.chromium.org/1420923003
2015-10-22 13:03:02 -07:00
mtklein
70084cbc16 SkTime::GetNSecs()
- Move high-precision wall timers from tools/timer to SkTime.
   - Implement SkTime::GetMSecs() in terms of SkTime::GetNSecs().
   - Delete unused tools/timer code.

I have no idea what's going on there in src/animator.
I don't intend to investigate.

BUG=skia:

Review URL: https://codereview.chromium.org/1422513003
2015-10-22 12:47:04 -07:00
senorblanco
9a70b6ef59 Image filters: refactor input GPU processing into filterInputGPU().
(analog of CPU version here: https://codereview.chromium.org/1404743005/)

No change in behaviour; this is a straight refactoring.

BUG=skia:3194

Review URL: https://codereview.chromium.org/1393283008
2015-10-16 11:35:14 -07:00
senorblanco
b9519f86bb Image Filters: refactor all CPU input processing into a filterInput helper function.
No change in behaviour; this is a straight refactoring.

BUG=skia:3194

Review URL: https://codereview.chromium.org/1404743005
2015-10-15 12:15:13 -07:00
bsalomon
5f5527fb46 Remove params from Cacherator_GrTextureMaker
Review URL: https://codereview.chromium.org/1403313003
2015-10-15 12:14:55 -07:00
robertphillips
2e1e51f049 GrDrawContext now holds GrRenderTarget pointer
Review URL: https://codereview.chromium.org/1404823005
2015-10-15 08:01:49 -07:00
reed
94dd7a52d3 change back to method for localmatrix imagefilter
This method is different from MatrixFilter, in that MatrixFilter does not require a pre-existing
filter, but LocalM does. Also change the comment to be more general, as there is no promise that
we return a different subclass, and certainly not a specific subclass.

This pattern of obj->newWithModifiers() also more closely matches the pattern in SkImage (newSubset).

BUG=skia:

Review URL: https://codereview.chromium.org/1402133002
2015-10-14 07:49:35 -07:00
senorblanco
20311d4843 Implement SkLocalMatrixImageFilter.
At draw time, this filter simply concatenates the given matrix to the
CTM, and recurses on its input. The matrix is thus applied to any
upstream filter parameters and crop rects.

BUG=skia:

Review URL: https://codereview.chromium.org/1392833005
2015-10-14 04:53:31 -07:00
reed
d82bc7b90a post-commit fixes to applyFilter CL
BUG=skia:

Review URL: https://codereview.chromium.org/1404483002
2015-10-12 13:17:23 -07:00
reed
88d064d0e4 add applyFilter() to SkImage
Result:
- clients can get a filtered version of an image without having to setup a temp drawing environment
- for some cases, the process is more efficient even than (deprecated) drawSprite, since there is no need to draw/copy the result

Impl:
- made Proxy virtual so we don't need to have an existing device to use it

This, in conjunction with LocalMatrixImageFilter, should allow us to simplify and optimize ApplyImageFilter() in cc/output/gl_renderer.cc

BUG=skia:

Review URL: https://codereview.chromium.org/1390913005
2015-10-12 11:30:02 -07:00
bsalomon
afa95e270c Remove image usage type enum. Use GrTextureParams instead.
BUG=skia:

Review URL: https://codereview.chromium.org/1404433002
2015-10-12 10:39:46 -07:00
reed
33366974d4 remove internalDrawBitmap, as it is no longer shared with any other caller, and can be folded into onDrawBitmap
BUG=skia:

Review URL: https://codereview.chromium.org/1391333004
2015-10-08 09:22:02 -07:00
mtklein
bf90520f63 SkPath::fFirstDirection: seq-cst -> relaxed
We landed this originally with lazily-correct sequentially-consistent memory
order.  It turns out that's regressed performance, we think particularly when
recording paths.  We also think there's no need for anything but relaxed memory
order here.

We should see this chart go down if all goes well: https://perf.skia.org/#4329
There are also Chrome performance charts to watch in the linked bug.

BUG=chromium:537700

CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-TSAN-Trybot,Test-Ubuntu-GCC-Golo-GPU-GT610-x86_64-Release-TSAN

No public API changes.
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1393833003
2015-10-07 12:46:43 -07:00
bsalomon
4a33952961 Bye bye processor data manager.
Review URL: https://codereview.chromium.org/1388113002
2015-10-06 08:40:51 -07:00
cdalton
cdd7907a3d Implement cached nvpr text blobs
BUG=skia:

Review URL: https://codereview.chromium.org/1381073002
2015-10-05 15:37:35 -07:00
reed
af3fbfca0a SkImage doesn't use props, so don't need to store it
BUG=skia:
TBR=bsalomon

Review URL: https://codereview.chromium.org/1372153006
2015-10-04 11:28:36 -07:00
bungeman
77a53de20d Base SkAutoTUnref on skstd::unique_ptr.
To further consolidate the various unique owning classes, this bases
SkAutoTUnref on skstd::unique_ptr. Users are updated because of two
breaking changes, swap now takes a reference and reset no longer
returns its argument.

Review URL: https://codereview.chromium.org/1370803002
2015-10-01 12:28:49 -07:00
ssid
f0c986503b Add support for light dumps in SkTraceMemoryDump interface.
SkGlyphCache dumps too many glyphs, and to reduce the trace size,
RequestDetails enum is added to SkTraceMemoryDump interface. This
would tell caches to dump only requested details or not a detailed
dump.

BUG=499731

Review URL: https://codereview.chromium.org/1310123007
2015-09-30 04:31:23 -07:00
mtklein
242397a1c9 Revert of Implement SkImageFilter::Cache with SkResourceCache. (patchset #8 id:140001 of https://codereview.chromium.org/1370323002/ )
Reason for revert:
Landed PS8 temporarily to trigger the perf bots.

Original issue's description:
> Implement SkImageFilter::Cache with SkResourceCache.
>
> The single global cache now uses the global SkResourceCache,
> and any Create()ed cache uses a local SkResourceCache.
>
> No real public API changes (and only deletes).
>
> I don't see any pixel diffs on .skps or GMs.
> Don't see any significant perf difference on 8888 or gpu configs.
> DM peak memory usage did drop by about 113M, close to the 128M cache size.
>
> BUG=skia:3662
>
> Landing PS8 temporarily to trigger the perf bots.
> TBR=reed@google.com
>
> Committed: https://skia.googlesource.com/skia/+/75135d8ae1aa12e8e6bfce63291e5e876a77546f

TBR=reed@google.com,robertphillips@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:3662

Review URL: https://codereview.chromium.org/1381523002
2015-09-29 12:17:08 -07:00
mtklein
75135d8ae1 Implement SkImageFilter::Cache with SkResourceCache.
The single global cache now uses the global SkResourceCache,
and any Create()ed cache uses a local SkResourceCache.

No real public API changes (and only deletes).

I don't see any pixel diffs on .skps or GMs.
Don't see any significant perf difference on 8888 or gpu configs.
DM peak memory usage did drop by about 113M, close to the 128M cache size.

BUG=skia:3662

Landing PS8 temporarily to trigger the perf bots.
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1370323002
2015-09-29 12:15:52 -07:00
herb
62a69c26b3 Move Mutexy things to private.
There is no API change.

TBR=reed@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/1368333004
2015-09-29 11:47:45 -07:00
robertphillips
05302f8f24 Handle inverted rects in SkRRect creation methods
An alternative way of addressing this is to alter SkCanvas::drawRoundRect to just reject isEmpty (i.e., un-sorted or truly empty) input rects.

BUG=skia:3786

Review URL: https://codereview.chromium.org/1373293002
2015-09-29 11:24:07 -07:00
mtklein
3d096654b9 update memset16/32 inlining heuristics
I spent some time looking at perf.skia.org and it looks like we can do better.

It is weird, weird, weird that on x86, we see three completely different behaviors:
  - x86 Android: inlining better for small N, custom better for large N;
  - Windows:     inlining better for large N, custom better for small N;
  - other x86:   inlining generally better

BUG=skia:4316,chromium:516426

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

Summaries: https://perf.skia.org/#4179
All traces, log scale: https://perf.skia.org/#4180

TBR=reed@google.com
No public API changes.

Review URL: https://codereview.chromium.org/1357193002
2015-09-29 10:38:59 -07:00
bsalomon
e25eea4b36 Use child processors to implement compose color filter.
Review URL: https://codereview.chromium.org/1368423003
2015-09-29 06:38:55 -07:00
herb
e6e41a8a19 Move SkAtomics.h to private.
There are no API changes.

TBR=reed@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/1369333004
2015-09-28 11:24:13 -07:00
herb
9f4dbca329 Make SkPath fFirstDirection atomic to fix tsan.
There is no API change.

TBR=reed@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/1372103003
2015-09-28 11:05:47 -07:00
reed
c9e190ddac Revert of change pixel-serializer to support reencoding existing data (patchset #5 id:80001 of https://codereview.chromium.org/1373683003/ )
Reason for revert:
Need to somehow get access to encoders in chrome -- link error on the roll since SkImageEncoder is not built as part of chrome.

Original issue's description:
> change pixel-serializer to support reencoding existing data
>
> Trying to evolve this interface so it can
> - support rich set of backend-encoders (including ones like ETC1 that can cheaply convert to KXT
> - allow for encoding images as well as bitmaps (e.g. for picture serialization)
> - perhaps replace SkImageEncoder as an API (assuming we create a factory that returns a serializer given a format)
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/13f48dc85aa68a60da66aaf39c93d527d11d1278

TBR=scroggo@google.com,msarett@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1371983003
2015-09-28 09:58:41 -07:00
herb
0869267a7c Add cast and assignment operators to SkAtomic.
This is not really an API change.

TBR=reed@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/1369333002
2015-09-28 08:59:18 -07:00
reed
13f48dc85a change pixel-serializer to support reencoding existing data
Trying to evolve this interface so it can
- support rich set of backend-encoders (including ones like ETC1 that can cheaply convert to KXT
- allow for encoding images as well as bitmaps (e.g. for picture serialization)
- perhaps replace SkImageEncoder as an API (assuming we create a factory that returns a serializer given a format)

BUG=skia:

Review URL: https://codereview.chromium.org/1373683003
2015-09-28 08:58:53 -07:00
bsalomon
f1b7a1d828 Make skpaint->grpaint flow work for composing draws (verts and atlas)
One side effect is that the SkShader's (or implicit shader's) fragment processor is responsible for the transition from an unpremul paint color to a premul color.

Review URL: https://codereview.chromium.org/1348583002
2015-09-28 06:26:29 -07:00
fmalita
2f5891ea64 Remove SkBitmapSource
To avoid breaking existing SKPs, add a deserialization stub which
unflattens SkBitmapSource records to SkImageSources.

R=reed@google.com,mtklein@google.com,robertphillips@google.com

Review URL: https://codereview.chromium.org/1363913002
2015-09-25 09:15:55 -07:00
reed
d114645d93 SkInstallDiscardablePixelRef is deprecated, enforce that
No functionality change, just a renaming.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1372593002
2015-09-25 06:56:57 -07:00
mdempsky
00d6e515e5 Eliminate some clutter in SkFlattenable
The Registrar class is unnecessary, as SkFlattenable factory
registration is now handled via initialization routines that can just
call the Register function directly.

Also, no need to lazily initialize gCount to 0, as initializing an int
to a constant value does not require dynamic initialization.  (C++
actually guarantees zero initialization of global ints anyway, but
existing practice in Skia appears to favor the explicit "= 0").

Relatedly, this requires removing the unused/unimplemented
SkLayerDrawLooper::MyRegistrar class.  And removing that allows Clang
to realize that SkLayerDrawLooper::fTopRec is unneeded too, so remove
that too to squelch the compiler warning/error.

This doesn't change any public API.
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1361323002
2015-09-24 15:04:45 -07:00
fmalita
3f9deab9fc Remove SkImage::newImage()
All clients converted to newSubset().

R=reed@google.com

Review URL: https://codereview.chromium.org/1364263002
2015-09-24 07:43:41 -07:00