Commit Graph

5245 Commits

Author SHA1 Message Date
scroggo
db30be2f94 Make SkCodec support peek() and read()
- Update SkCodec's dox to point out that some of the data must be
  read twice in order to decode
- Add an accessor that reports how much is needed for reading twice
- Make SkCodec default to use peek()
  If an input stream supports peek()ing, peek() instead of reading.
  This way the stream need not implement rewind()
- Make SkCodec use read() + rewind() as a backup
  So that streams without peek() implemented can still function
  properly (assuming they can rewind).
- read everything we may need to determine the format once
  In SkCodec::NewFromStream, peek()/read() 14 bytes, which is enough
  to read all of the types we support. Pass the buffer to each subtype,
  which will have enough info to determine whether it is the right
  type. This simplifies the code and results in less reading and
  rewinding.
  - NOTE: SkWbmpCodec needs the following number of bytes for the header
    + 1 (type)
    + 1 (reserved)
    + 3 (width - bytes needed to support up to 0xFFFF)
    + 3 (height - bytes needed to support up to 0xFFFF)
    = 8
- in SkWebpCodec, support using read + rewind as a backup if peek does
  not work.

A change in Android will add peek() to JavaInputStreamAdapter.

BUG=skia:3257

Review URL: https://codereview.chromium.org/1472123002
2015-12-08 18:54:13 -08:00
jvanverth
0671b967eb Move texture drawing utility method to SkGpuDevice
BUG=skia:4542

Review URL: https://codereview.chromium.org/1506203002
2015-12-08 18:53:44 -08:00
scroggo
f01610effc Remove staging for SkImageDecoder::Peeker
Will no longer be needed once ag/817367 lands - Android will be
inheriting directly from SkPngChunkReader, so no need for the
intermediate.

BUG=skia:4574

Review URL: https://codereview.chromium.org/1470913004
2015-12-08 18:48:38 -08:00
mtklein
cc881dafcb Add sk_careful_memcpy to catch undefined behavior in memcpy.
It's undefined behavior to pass null as src or dst to memcpy, even if len is 0.
This currently triggers -fsanitize=attribute-nonnull warnings, but also can
lead to very unexpected code generation with GCC.

sk_careful_memcpy() checks len first before calling memcpy(),
which prevents that weird undefined situation.

This allows me to mark all sanitizers as no-recover, i.e. make-the-bots-red fatal.

CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN-Trybot

BUG=skia:4641
NOTREECHECKS=true

Review URL: https://codereview.chromium.org/1510683002
2015-12-08 11:55:17 -08:00
reed
290f00cd75 Revert of default SkPixelSerializer (patchset #1 id:1 of https://codereview.chromium.org/1507123002/ )
Reason for revert:
Breaking DEPS roll (linker error)

Original issue's description:
> default SkPixelSerializer
>
> Add SkImageEncoder::EncodeData(const SkPixmap&, ...) function.
>
> Add SkImageEncoder::CreatePixelSerializer() to return a
> PixelSerializer that calls into SkImageEncoder::EncodeData.
>
> SkImage::encode() make use of SkImageEncoder::CreatePixelSerializer.
>
> Committed: https://skia.googlesource.com/skia/+/b0bd1516bff3f5afcbfd615e805867531657811b

TBR=scroggo@google.com,halcanary@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1505203003
2015-12-08 10:59:13 -08:00
halcanary
b0bd1516bf default SkPixelSerializer
Add SkImageEncoder::EncodeData(const SkPixmap&, ...) function.

Add SkImageEncoder::CreatePixelSerializer() to return a
PixelSerializer that calls into SkImageEncoder::EncodeData.

SkImage::encode() make use of SkImageEncoder::CreatePixelSerializer.

Review URL: https://codereview.chromium.org/1507123002
2015-12-08 10:29:58 -08:00
cdalton
8ff8d24c83 Remove drawPathsFromRange from GrDrawContext
Replaces drawPathsFromRange with a more general drawPathBatch method.
While this still isn't perfect, it's a step in the right direction that
removes the need for path range draws to fit in a public API.

BUG=skia:

Review URL: https://codereview.chromium.org/1506823004
2015-12-08 10:20:32 -08:00
mtklein
97466ab03e fix funky formatting in SkNVRefCnt
BUG=skia:
TBR=reed@google.com
No API change.

Review URL: https://codereview.chromium.org/1505023002
2015-12-07 13:37:00 -08:00
halcanary
6b28017781 SkPixelSerializer: support indexed pixels
By taking a SkPixmap, SkPixelSerializer::encode() can now handle colortables.

Review URL: https://codereview.chromium.org/1501303002
2015-12-07 12:42:24 -08:00
scroggo
d61c384342 Allow SkStream::peek() to partially succeed
If the stream can peek less than requested, peek that amount. Return
the number of bytes peeked.

This simplifies crrev.com/1472123002. For a stream that is smaller than
14 bytes, it can successfully peek, meaning the client will not need to
fall back to read() + rewind(), which may fail if the stream can peek
but not rewind.

This CL revives code from patch set 3 of crrev.com/1044953002, where I
initially introduced peek() (including tests).

Add a test for SkFrontBufferedStream that verifies that peeking does
not make rewind() fail (i.e. by reading past the internal buffer).

BUG=skia:3257

Review URL: https://codereview.chromium.org/1490923005
2015-12-07 11:37:13 -08:00
thakis
573ce20f42 clang/win: Let SK_TRACEHR not produce -Wunused-value warnings in release builds.
Fixes warnings like:
..\..\third_party\skia\include\utils\win\SkHRESULT.h(51,23) :  note: expanded from macro 'HRNM'
                      ^~~~~~~~~~~~~~~~~~~~~~~~~
..\..\third_party\skia\include\utils\win\SkHRESULT.h(26,20) :  note: expanded from macro 'HR_GENERAL'
        SK_TRACEHR(_hr, _msg);\
                   ^~~
..\..\third_party\skia\include\utils\win\SkHRESULT.h(20,31) :  note: expanded from macro 'SK_TRACEHR'
                              ^~~

BUG=chromium:505318
TBR=reed
This is a trivial implementation change.

Review URL: https://codereview.chromium.org/1503463004
2015-12-07 10:41:36 -08:00
halcanary
0745653a67 SkAlphaThresholdFilter.h allow flattening
Motivation:  allows this:

    #include "SkAlphaThresholdFilter.h"
    void init() {
      SkAlphaThresholdFilter::InitializeFlattenables();
    }

BUG=skia:4613

Review URL: https://codereview.chromium.org/1500373003
2015-12-07 10:29:54 -08:00
senorblanco
a544eda5dd Matrix convolution bounds fix; affectsTransparentBlack fixes.
Because the convolution kernel is (currently) applied in device space,
there's no way to know which object-space pixels will be touched. So
return false from canComputeFastBounds().

The results from the matrixconvolution GM were actually wrong, since
they were showing edge differences on the clip boundaries, where they
should really only show on crop boundaries. I added a crop to the GM
to keep the results the same (which are useful to test the different
convolution tile modes).

While I was at it, SkImageFilter::affectsTransparentBlack() was
inapplicable on most things except color filters, and its use on
leaf nodes was confusing. So I removed it, and made
SkImageFilter::canComputeFastBounds() virtual instead.

BUG=skia:4630

Review URL: https://codereview.chromium.org/1500923004
2015-12-07 07:48:34 -08:00
reed
262a71b7f9 detect when we can filter bitmaps/images directly, w/o a tmp layer
visual bench run on Mac Pro

curr/maxrss	loops	min	median	mean	max	stddev	samples   	config	bench
 100/100 MB	16	412µs	413µs	413µs	414µs	0%	▄▁▇▄▄▄▄█▄▃▅	gpu	warmupbench
 101/102 MB	32	547µs	548µs	611µs	1.24ms	34%	█▁▁▁▁▁▁▁▁▁▁	gpu	image-filter-sprite-draw-image
 102/103 MB	32	547µs	548µs	721µs	1.23ms	41%	█▁▇▁▁█▁▁▁▁▁	gpu	image-filter-sprite-draw-bitmap
 103/103 MB	64	546µs	546µs	546µs	547µs	0%	▆▄▂▁▇█▅▇▅▇▃	gpu	image-filter-sprite-draw-sprite

Should have no effect on Chrome while SK_SUPPORT_LEGACY_LAYER_BITMAP_IMAGEFILTERS is defined (which it is in chrome)

BUG=skia:1073

Review URL: https://codereview.chromium.org/1491293002
2015-12-05 13:07:27 -08:00
senorblanco
50c044b9ad Revert of Matrix convolution bounds fix; affectsTransparentBlack fixes. (patchset #4 id:60001 of https://codereview.chromium.org/1500923004/ )
Reason for revert:
Introduced memory leak; pixel changes in Chrome.

Original issue's description:
> Matrix convolution bounds fix; affectsTransparentBlack fixes.
>
> Because the convolution kernel is (currently) applied in device space,
> there's no way to know which object-space pixels will be touched. So
> return false from canComputeFastBounds().
>
> The results from the matrixconvolution GM were actually wrong, since
> they were showing edge differences on the clip boundaries, where they
> should really only show on crop boundaries. I added a crop to the GM
> to keep the results the same (which are useful to test the different
> convolution tile modes).
>
> While I was at it, SkImageFilter::affectsTransparentBlack() was
> inapplicable on most things except color filters, and its use on
> leaf nodes was confusing. So I removed it, and made
> SkImageFilter::canComputeFastBounds() virtual instead.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/8705ec80518ef551994b82ca5ccaeb0241d6adec

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

Review URL: https://codereview.chromium.org/1497083005
2015-12-05 05:59:41 -08:00
senorblanco
8705ec8051 Matrix convolution bounds fix; affectsTransparentBlack fixes.
Because the convolution kernel is (currently) applied in device space,
there's no way to know which object-space pixels will be touched. So
return false from canComputeFastBounds().

The results from the matrixconvolution GM were actually wrong, since
they were showing edge differences on the clip boundaries, where they
should really only show on crop boundaries. I added a crop to the GM
to keep the results the same (which are useful to test the different
convolution tile modes).

While I was at it, SkImageFilter::affectsTransparentBlack() was
inapplicable on most things except color filters, and its use on
leaf nodes was confusing. So I removed it, and made
SkImageFilter::canComputeFastBounds() virtual instead.

BUG=skia:

Review URL: https://codereview.chromium.org/1500923004
2015-12-04 13:57:31 -08:00
joshualitt
91d0620586 fix mozilla bug
TBR=bsalomon@google.com
BUG=skia:4621

Review URL: https://codereview.chromium.org/1500023002
2015-12-04 08:51:11 -08:00
msarett
be8216a922 Make SkAndroidCodec support ico
BUG=skia:

Review URL: https://codereview.chromium.org/1472933002
2015-12-04 08:00:50 -08:00
scroggo
97ff7f5662 Revert of Make SkAndroidCodec support ico (patchset #7 id:130002 of https://codereview.chromium.org/1472933002/ )
Reason for revert:
Crashing: https://uberchromegw.corp.google.com/i/client.skia.android/builders/Test-Android-GCC-NexusPlayer-CPU-SSE4-x86-Release/builds/1499/steps/dm/logs/stdio

Also, related ASAN failures:
https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN/builds/3676/steps/dm/logs/stdio

Original issue's description:
> Make SkAndroidCodec support ico
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/1603e9310f62cf0dd543cdb09dea06aa78373f13

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

Review URL: https://codereview.chromium.org/1498903004
2015-12-04 07:09:57 -08:00
robertphillips
433625e67c Reduce calls sites where both the GrDrawContext & GrRenderTarget are both passed
TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/1494083003
2015-12-04 06:58:16 -08:00
msarett
1603e9310f Make SkAndroidCodec support ico
BUG=skia:

Review URL: https://codereview.chromium.org/1472933002
2015-12-04 05:43:09 -08:00
bsalomon
6dea83f244 Add option to draw wireframe batch bounds
Committed: https://skia.googlesource.com/skia/+/26489ef21ff5df33b8cb5943fddfd4604e203960

Review URL: https://codereview.chromium.org/1494473005
2015-12-03 12:58:06 -08:00
msarett
cb0d5c940a Add currScanline() getter to SkCodec API
This is more correct than using nextScanline() for the
SkGifCodec scanline decoder (since we will get a strange
result in the interlaced case) and is necessary if we want
to add scanline decoding to SkIcoCodec.

This does not actually fix bugs or change behavior.

BUG=skia:

Review URL: https://codereview.chromium.org/1489163002
2015-12-03 12:23:43 -08:00
erikchen
2b1516fe35 Update documentation for SkFontMgr methods.
The appropriate way to get the default system font is to pass |nullptr| as the
familyName. This was not clear from the interface, which may be why ui/gfx/ has
the wrong behavior.

BUG=chromium:564266

Review URL: https://codereview.chromium.org/1494253002
2015-12-03 12:12:13 -08:00
scroggo
e2725f5840 Revert of Add option to draw wireframe batch bounds (patchset #6 id:100001 of https://codereview.chromium.org/1494473005/ )
Reason for revert:
Looks to be responsible for breaking builds e.g. https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-GPU-HD4000-x86_64-Debug/builds/3030/steps/dm/logs/stdio

Original issue's description:
> Add option to draw wireframe batch bounds
>
> Committed: https://skia.googlesource.com/skia/+/26489ef21ff5df33b8cb5943fddfd4604e203960

TBR=joshualitt@google.com,bsalomon@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1492633007
2015-12-03 10:30:34 -08:00
bsalomon
26489ef21f Add option to draw wireframe batch bounds
Review URL: https://codereview.chromium.org/1494473005
2015-12-03 09:36:49 -08:00
reed
7850eb2f35 API to support native scaling by image-generator
BUG=skia:

Review URL: https://codereview.chromium.org/1396323007
2015-12-02 14:19:47 -08:00
joshualitt
dc5685ac37 Wire up resource cache stats dumping in nanobench
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1495543003
2015-12-02 14:08:25 -08:00
joshualitt
f16f88b779 Create a define for nanobench builds to dump stats
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1499453002
2015-12-02 13:00:37 -08:00
mtklein
5c05d10511 Revert of skstd -> std for unique_ptr (patchset #17 id:320001 of https://codereview.chromium.org/1436033003/ )
Reason for revert:
Chromium bots can't handle forward declared types, e.g.

struct Foo {
   int x,y;
   std::unique_ptr<Foo> next;
};

https://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/86497

Original issue's description:
> skstd -> std for unique_ptr
>
> TBR=reed@google.com
> No public API changes.
>
> BUG=skia:4564
>
> Committed: https://skia.googlesource.com/skia/+/755c553c17b82bb5de3d9cc8d3b2a866ff9e9e50
>
> CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot,Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot;client.skia:Perf-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Release-Trybot,Test-iOS-Clang-iPad4-GPU-SGX554-Arm7-Release-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/06189155d987db5c7e69015f6ea87c2168d6a065
>
> Committed: https://skia.googlesource.com/skia/+/70e8dfca4a7f5bce97b8021a6e378c4828b09c8c
>
> Committed: https://skia.googlesource.com/skia/+/dadfc245cc9a0279ff7b73da3344f2ca5d139907

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

Review URL: https://codereview.chromium.org/1498583002
2015-12-02 12:32:02 -08:00
mtklein
dadfc245cc skstd -> std for unique_ptr
TBR=reed@google.com
No public API changes.

BUG=skia:4564

Committed: https://skia.googlesource.com/skia/+/755c553c17b82bb5de3d9cc8d3b2a866ff9e9e50

CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot,Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot;client.skia:Perf-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Release-Trybot,Test-iOS-Clang-iPad4-GPU-SGX554-Arm7-Release-Trybot

Committed: https://skia.googlesource.com/skia/+/06189155d987db5c7e69015f6ea87c2168d6a065

Committed: https://skia.googlesource.com/skia/+/70e8dfca4a7f5bce97b8021a6e378c4828b09c8c

Review URL: https://codereview.chromium.org/1436033003
2015-12-02 10:46:18 -08:00
joshualitt
e45c81c8f3 Began logging more gpu stats from nanobench
BUG=skia:

Review URL: https://codereview.chromium.org/1489033004
2015-12-02 09:05:38 -08:00
msarett
7d5105c4d2 Allow SkAndroidCodec to use SkPngChunkReader
Also update documentation of SkPngChunkReader
in SkCodec.

BUG=skia:

Review URL: https://codereview.chromium.org/1487583003
2015-12-02 07:02:41 -08:00
robertphillips
7bceedc550 Retract GrRenderTarget a bit
These sites don't necessarily need the full power of a GrRenderTarget object. This is a clean up for switching over to GrRenderTargetProxys.

Review URL: https://codereview.chromium.org/1486923004
2015-12-01 12:51:26 -08:00
fmalita
aa0df4e98d Add an SkPath conic conversion utility.
Expose SkConic::chopIntoQuadsPOW2() as SkPath::ConvertConicToQuads().

BUG=chromium:315277
R=reed@google.com

Review URL: https://codereview.chromium.org/1484373002
2015-12-01 09:13:23 -08:00
halcanary
0cbe7ee765 CMake, include/: changes to make fiddle 2.0 better
cmake: remove unused directories from skia.h / ${public_includes}

SkPreConfig.h:  work around buggy `#ifdef linux`

include:  guard many platform-specific headers
CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot

Review URL: https://codereview.chromium.org/1488813002
2015-12-01 09:02:49 -08:00
lsalzman
c19247fd03 check that SSE2 is available before using __vectorcall
BUG=skia:4563

Review URL: https://codereview.chromium.org/1489873002
2015-12-01 07:21:09 -08:00
bsalomon
69cfe95b7b Add debug option to clip each GrBatch to its device bounds
Review URL: https://codereview.chromium.org/1471083002
2015-11-30 13:27:47 -08:00
egdaniel
56cf6dcb65 Create a static instances of SrcOver XferProcessor
BUG=skia:

Review URL: https://codereview.chromium.org/1471293003
2015-11-30 10:15:58 -08:00
ethannicholas
de4166a3b4 APIs which took colorPOI / coveragePOI pairs updated to take a GrPipelineOptimizations struct
TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/1480353002
2015-11-30 08:57:38 -08:00
mtklein
e066df9673 Revert of skstd -> std for unique_ptr (patchset #16 id:300001 of https://codereview.chromium.org/1436033003/ )
Reason for revert:
Test-iOS-Clang-iPad4-GPU-SGX554-Arm7-Release

Original issue's description:
> skstd -> std for unique_ptr
>
> TBR=reed@google.com
> No public API changes.
>
> BUG=skia:4564
>
> Committed: https://skia.googlesource.com/skia/+/755c553c17b82bb5de3d9cc8d3b2a866ff9e9e50
>
> CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot,Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot;client.skia:Perf-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Release-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/06189155d987db5c7e69015f6ea87c2168d6a065
>
> Committed: https://skia.googlesource.com/skia/+/70e8dfca4a7f5bce97b8021a6e378c4828b09c8c

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

Review URL: https://codereview.chromium.org/1482343002
2015-11-30 07:17:39 -08:00
mtklein
70e8dfca4a skstd -> std for unique_ptr
TBR=reed@google.com
No public API changes.

BUG=skia:4564

Committed: https://skia.googlesource.com/skia/+/755c553c17b82bb5de3d9cc8d3b2a866ff9e9e50

CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot,Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot;client.skia:Perf-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Release-Trybot

Committed: https://skia.googlesource.com/skia/+/06189155d987db5c7e69015f6ea87c2168d6a065

Review URL: https://codereview.chromium.org/1436033003
2015-11-30 07:07:02 -08:00
herb
11a7f7f599 Remove SkDrawProcs
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1476563002
2015-11-24 12:41:01 -08:00
mtklein
b68ce74bd1 Add SK_BEGIN_REQUIRE_DENSE / SK_END_REQUIRE_DENSE.
Use in on a few examples of things we hash.

BUG=skia:

Review URL: https://codereview.chromium.org/1468483002
2015-11-24 05:35:58 -08:00
bsalomon
bf07455533 Make stencil and cover path rendering have more reasonable bounds.
BUG=skia:

Review URL: https://codereview.chromium.org/1471883002
2015-11-23 14:25:20 -08:00
egdaniel
c4b72720e7 Don't create a GXPFactory when blend is SrcOver
BUG=skia:

Review URL: https://codereview.chromium.org/1471053002
2015-11-23 13:20:42 -08:00
reed
095530389d scaling API on SkPixmap
BUG=skia:4481

Review URL: https://codereview.chromium.org/1463373002
2015-11-23 12:32:16 -08:00
mtklein
dfd7d48ced Revert of skstd -> std for unique_ptr (patchset #16 id:300001 of https://codereview.chromium.org/1436033003/ )
Reason for revert:
Perf-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Release has not updated yet.

Original issue's description:
> skstd -> std for unique_ptr
>
> TBR=reed@google.com
> No public API changes.
>
> BUG=skia:4564
>
> Committed: https://skia.googlesource.com/skia/+/755c553c17b82bb5de3d9cc8d3b2a866ff9e9e50
>
> CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot,Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/06189155d987db5c7e69015f6ea87c2168d6a065

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

Review URL: https://codereview.chromium.org/1467333002
2015-11-23 09:19:37 -08:00
mtklein
06189155d9 skstd -> std for unique_ptr
TBR=reed@google.com
No public API changes.

BUG=skia:4564

Committed: https://skia.googlesource.com/skia/+/755c553c17b82bb5de3d9cc8d3b2a866ff9e9e50

CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot,Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot

Review URL: https://codereview.chromium.org/1436033003
2015-11-23 09:12:31 -08:00
scroggo
cf98fa9311 Add SkPngChunkReader.
This class allows a client of SkCodec to read chunks in the data
stream that are not recognized by libpng. This is used by Android
to specify ninepatch data.

Taken from SkImageDecoder::Peeker. Modify the name of the class
and its method to be more specific to their use. Make
SkImageDecoder::Peeker a subclass of the new class, to help stage
the change in Android.

Add a test to verify that it works.

BUG=skia:4574
BUG=skia:3257

Committed: https://skia.googlesource.com/skia/+/3389e00136188800b98ca69488c0418c374fd78b

Review URL: https://codereview.chromium.org/1040453002
2015-11-23 08:14:40 -08:00
scroggo
93c69fff53 Revert of Add SkPngChunkReader. (patchset #9 id:160001 of https://codereview.chromium.org/1040453002/ )
Reason for revert:
Busted Chromium builds:

../../third_party/skia/src/ports/SkImageDecoder_empty.cpp:63:17: error: no type
named 'Peeker' in 'SkImageDecoder'
SkImageDecoder::Peeker* SkImageDecoder::setPeeker(Peeker*) {
~~~~~~~~~~~~~~~~^
../../third_party/skia/src/ports/SkImageDecoder_empty.cpp:63:51: error: unknown
type name 'Peeker'
SkImageDecoder::Peeker* SkImageDecoder::setPeeker(Peeker*) {

Original issue's description:
> Add SkPngChunkReader.
>
> This class allows a client of SkCodec to read chunks in the data
> stream that are not recognized by libpng. This is used by Android
> to specify ninepatch data.
>
> Taken from SkImageDecoder::Peeker. Modify the name of the class
> and its method to be more specific to their use. Make
> SkImageDecoder::Peeker a subclass of the new class, to help stage
> the change in Android.
>
> Add a test to verify that it works.
>
> BUG=skia:4574
> BUG=skia:3257
>
> Committed: https://skia.googlesource.com/skia/+/3389e00136188800b98ca69488c0418c374fd78b

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

Review URL: https://codereview.chromium.org/1472863003
2015-11-23 07:56:39 -08:00
scroggo
3389e00136 Add SkPngChunkReader.
This class allows a client of SkCodec to read chunks in the data
stream that are not recognized by libpng. This is used by Android
to specify ninepatch data.

Taken from SkImageDecoder::Peeker. Modify the name of the class
and its method to be more specific to their use. Make
SkImageDecoder::Peeker a subclass of the new class, to help stage
the change in Android.

Add a test to verify that it works.

BUG=skia:4574
BUG=skia:3257

Review URL: https://codereview.chromium.org/1040453002
2015-11-23 07:20:57 -08:00
bsalomon
7ea33f5e1a Initial version of external_oes texture support and unit test
Committed: https://skia.googlesource.com/skia/+/27a048700778d4cebfc23301d1780649791b0e03

Review URL: https://codereview.chromium.org/1451683002
2015-11-22 14:51:00 -08:00
bsalomon
0315dbcb55 Revert of Initial version of external_oes texture support and unit test (patchset #14 id:260001 of https://codereview.chromium.org/1451683002/ )
Reason for revert:
Error wrapping external texture in GrTexture on some devices.

Original issue's description:
> Initial version of external_oes texture support and unit test
>
> Committed: https://skia.googlesource.com/skia/+/27a048700778d4cebfc23301d1780649791b0e03

TBR=joshualitt@google.com,egdaniel@google.com,robertphillips@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1459323004
2015-11-20 20:24:31 -08:00
bsalomon
27a0487007 Initial version of external_oes texture support and unit test
Review URL: https://codereview.chromium.org/1451683002
2015-11-20 19:34:37 -08:00
egdaniel
f234272cbd Revert of Make specialized SrcOver XPFactory (patchset #3 id:40001 of https://codereview.chromium.org/1455273006/ )
Reason for revert:
breaking some builds

Original issue's description:
> Make specialized SrcOver XPFactory
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/a7006d45217d128a94fa53cb4b827cca79bc7049

TBR=bsalomon@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1464933003
2015-11-20 15:12:59 -08:00
egdaniel
a7006d4521 Make specialized SrcOver XPFactory
BUG=skia:

Review URL: https://codereview.chromium.org/1455273006
2015-11-20 14:01:07 -08:00
mtklein
e47f1a7c74 Fix UB in SkDivBits
This used to:
  DIVBITS_ITER was shifting bits up into the sign bit, which is a no-no.
  This turns numer into a uint32_t to make those defined, and adds a few notes.

  x >= 0 is always true for unsigned x, so we needed a few small logic refactors.

Instead it now:
  Only call SkDivBits if the old behavior is required.
  Usually, just do the divide with /.

BUG=skia:3562

Committed: https://skia.googlesource.com/skia/+/988adddd48322bfa3e3cb0c017cfce71fbbf1123

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

TBR=reed@google.com
No API change.

Review URL: https://codereview.chromium.org/1455163004
2015-11-20 13:58:19 -08:00
fmalita
9b137dc54e SkFontConfigInterface::createTypeface()
BUG=524578
R=bungeman@google.com,reed@google.com

Review URL: https://codereview.chromium.org/1454343003
2015-11-20 13:47:55 -08:00
halcanary
d76be9c79b Eliminate SkFILE: it always is the same as FILE.
Review URL: https://codereview.chromium.org/1467533003
2015-11-20 13:47:49 -08:00
reed
42b73eb003 enable conservative raster clipping
There may be other (better?) ways to enable this. For example, if we queried the device *before* we init our root DeviceCM, we wouldn't need this flag in InitFlags, since the device already has a virtual to opt-in ...

BUG=skia:

Review URL: https://codereview.chromium.org/1458153003
2015-11-20 13:42:42 -08:00
jvanverth
897c993763 Pack and align SkStrokeRec to 4-byte boundary.
The new key for the distance field path cache will contain an
SkStrokeRec. This change guarantees that we don't have any hidden
padding that has garbage values, thereby preventing apparently
equal keys from hashing to two different values. This also has
the nice effect of reducing the size of SkStrokeRec from 24 bytes
to 16 bytes.

Review URL: https://codereview.chromium.org/1465773003
2015-11-20 13:32:32 -08:00
caryclark
da707bf563 add SkPath::isRRect
Add helper to track when a round rect was added to a path,
and then return the SkRRect specification that describes it.

Move the implementation for SkPath::RawIter to SkPathRef so it can be used there as well.

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

Review URL: https://codereview.chromium.org/1461763004
2015-11-19 14:47:44 -08:00
mtklein
e9d2052e49 Record concat as Concat.
This seems to cause very slight diffs on GMs.
https://gold.skia.org/search2?issue=1462983002&unt=true&query=source_type%3Dgm&master=false

I'm not sure I understand why.
The diffs to at least pictureshader look like improvements.

BUG=skia:4584

Review URL: https://codereview.chromium.org/1462983002
2015-11-19 12:08:24 -08:00
mtklein
1d02a60fec Remove unsigned < signed comparison.
This triggers -Wsign-compare on some builds.
Not sure why none of those builds have -Werror set.

BUG=skia:4561

Review URL: https://codereview.chromium.org/1464543002
2015-11-19 09:53:22 -08:00
Brian Salomon
e416d940c6 Change prealloc number of child FPs be 1 rather than 2
TBR=joshualitt@google.com

Review URL: https://codereview.chromium.org/1458913003 .
2015-11-19 11:04:48 -05:00
bsalomon
418e26f86c Preallocate room for 2 child processors in FPs
Review URL: https://codereview.chromium.org/1456263003
2015-11-19 08:02:09 -08:00
joshualitt
33a5fce612 Initial implementation of GPU no filter NinePatch
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1454933002
2015-11-18 13:28:51 -08:00
benjaminwagner
58afee8220 Fix GOOGLE3 Android build.
DebugWriteToStderr isn't defined for Android. I'm not sure if I just didn't test compiling for Android or if this is due to a change in the base library.

BUG=skia:

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

Review URL: https://codereview.chromium.org/1438773003
2015-11-18 13:14:14 -08:00
fmalita
c08d53ee17 Parametric SkPath oval/rect/rrect starting point
Extend the SkPath API to allow specifying the contour starting point.

This will allow removing the explicit cubic code from Blink/Path.

BUG=chromium:315277
R=reed@google.com,caryclark@google.com

Review URL: https://codereview.chromium.org/1452203002
2015-11-17 09:53:29 -08:00
djsollen
aa6f739c99 Respect SkPictureRecorder::kPlaybackDrawPicture_RecordFlag for SkDrawables
Review URL: https://codereview.chromium.org/1452193002
2015-11-17 06:18:31 -08:00
mtklein
14102ca4cf __vectorcall needs SSE
We don't have builders in this mode, but Mozilla does.

BUG=skia:4563

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

Review URL: https://codereview.chromium.org/1445283002
2015-11-16 16:20:29 -08:00
reed
31b80a9dc6 increase pre-allocated MCRecs to match common android calling pattern
BUG=skia:

Review URL: https://codereview.chromium.org/1450093002
2015-11-16 13:22:24 -08:00
mtklein
566b23c571 Revert of skstd -> std for unique_ptr (patchset #9 id:160001 of https://codereview.chromium.org/1436033003/ )
Reason for revert:
10.9 bots are too old too.

Original issue's description:
> skstd -> std for unique_ptr
>
> TBR=reed@google.com
> No public API changes.
>
> BUG=skia:4564
>
> Committed: https://skia.googlesource.com/skia/+/755c553c17b82bb5de3d9cc8d3b2a866ff9e9e50

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

Review URL: https://codereview.chromium.org/1446413002
2015-11-16 13:05:37 -08:00
mtklein
755c553c17 skstd -> std for unique_ptr
TBR=reed@google.com
No public API changes.

BUG=skia:4564

Review URL: https://codereview.chromium.org/1436033003
2015-11-16 12:57:52 -08:00
mtklein
56da025020 Switch uses of SkChecksum::Compute to Murmur3.
SkChecksum::Compute is a very, very poorly distributed hash function.
This replaces all remaining uses with Murmur3.

The only interesting stuff is in src/gpu.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/1d024a3c909ae5cefa5e8b339e2b52dc73ee85ac

Committed: https://skia.googlesource.com/skia/+/540e95483d285b555e9b1a73d18c16e7d7c0deba

Review URL: https://codereview.chromium.org/1436973003
2015-11-16 11:16:23 -08:00
robertphillips
504ce5dc77 Optionally pass rendertarget to getTestTarget
This shouldn't really make any difference but allocating and holding on to a GrRenderTarget for each test target generates image differences for Mali GPUs. This CL allows an existing render target to be used for the test target.

TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/1447113002
2015-11-16 11:02:05 -08:00
mtklein
3c2d32b8e2 Revert of Switch uses of SkChecksum::Compute to Murmur3. (patchset #2 id:20001 of https://codereview.chromium.org/1436973003/ )
Reason for revert:
gotta put back *compute = 0.

Original issue's description:
> Switch uses of SkChecksum::Compute to Murmur3.
>
> SkChecksum::Compute is a very, very poorly distributed hash function.
> This replaces all remaining uses with Murmur3.
>
> The only interesting stuff is in src/gpu.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/1d024a3c909ae5cefa5e8b339e2b52dc73ee85ac
>
> Committed: https://skia.googlesource.com/skia/+/540e95483d285b555e9b1a73d18c16e7d7c0deba

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

Review URL: https://codereview.chromium.org/1448023005
2015-11-16 11:01:18 -08:00
mtklein
540e95483d Switch uses of SkChecksum::Compute to Murmur3.
SkChecksum::Compute is a very, very poorly distributed hash function.
This replaces all remaining uses with Murmur3.

The only interesting stuff is in src/gpu.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/1d024a3c909ae5cefa5e8b339e2b52dc73ee85ac

Review URL: https://codereview.chromium.org/1436973003
2015-11-16 09:08:21 -08:00
robertphillips
e004bfc0a5 Increase the amount of debug information printed out by batches
Untangling MDB bugs requires more information. In particular the render targets.

BUG=skia:4094
TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/1443763002
2015-11-16 09:06:59 -08:00
bsalomon
a779ef1677 Fix for chrome's skia gl bindings code.
TBR=egdaniel@google.com
NOTRY=true

Review URL: https://codereview.chromium.org/1451743002
2015-11-16 08:28:21 -08:00
bsalomon
b1a32ad517 Add support for EGLImage to GrGLInterface
BUG=skia:

Review URL: https://codereview.chromium.org/1434813002
2015-11-16 06:48:44 -08:00
egdaniel
57d3b039c6 Rename some processor functions from GL to GLSL
TBR=bsalomon@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/1443743002
2015-11-13 11:57:27 -08:00
egdaniel
fa4cc8bf2a Move XferProcessors to glsl
This is basically a move and rename

TBR=bsalomon@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/1440073002
2015-11-13 08:34:52 -08:00
mtklein
0274efbd3d Revert of Switch uses of SkChecksum::Compute to Murmur3. (patchset #2 id:20001 of https://codereview.chromium.org/1436973003/ )
Reason for revert:
I would not have expected this to change any images.

Looks like it's changed both MSAA and non-MSAA GMs:
https://gold.skia.org/search2?blame=1d024a3c909ae5cefa5e8b339e2b52dc73ee85ac&unt=true&head=true&query=source_type%3Dgm

Original issue's description:
> Switch uses of SkChecksum::Compute to Murmur3.
>
> SkChecksum::Compute is a very, very poorly distributed hash function.
> This replaces all remaining uses with Murmur3.
>
> The only interesting stuff is in src/gpu.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/1d024a3c909ae5cefa5e8b339e2b52dc73ee85ac

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

Review URL: https://codereview.chromium.org/1445523003
2015-11-13 07:07:47 -08:00
egdaniel
64c4728c70 Make all GrFragmentProcessors GL independent.
TBR=bsalomon@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/1434313002
2015-11-13 06:54:19 -08:00
msarett
506e19a4c8 Move SkBitmapRegionDecoder to include/android and src/android
This will expose the BitmapRegionDecoder API as a public include
and move the implementation to src.

This makes this code more naturally exposed in Android and easier
to test in DM and nanobench.

BUG=skia:

Review URL: https://codereview.chromium.org/1438873002
2015-11-13 06:11:09 -08:00
mtklein
1d024a3c90 Switch uses of SkChecksum::Compute to Murmur3.
SkChecksum::Compute is a very, very poorly distributed hash function.
This replaces all remaining uses with Murmur3.

The only interesting stuff is in src/gpu.

BUG=skia:

Review URL: https://codereview.chromium.org/1436973003
2015-11-12 15:44:09 -08:00
cdalton
c94cd7cc01 Fix GrCoverageSetOpXP unit test on mixed samples
Updates GrCoverageSetOpXPFactory::TestCreate to not invert coverage
with mixed samples, which is an unsupported configuration.

TBR=bsalomon@google.com

BUG=skia:4556

Review URL: https://codereview.chromium.org/1442763002
2015-11-12 12:11:04 -08:00
mtklein
23267db678 SkAtomic: always use std::atomic
We were doing it on Windows, now do it everywhere.
This just changes the backend.  We could think about another step to actually
replacing all our sk_atomic_... with std atomic stuff.

CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-TSAN-Trybot
TBR=reed@google.com
Only deleting from include/...

Review URL: https://codereview.chromium.org/1441773002
2015-11-12 11:07:53 -08:00
mtklein
64593525de Replace SkFunction with std::function
TBR=reed@google.com
No public API changes.

Review URL: https://codereview.chromium.org/1441753002
2015-11-12 10:41:05 -08:00
bungeman
147ea2fb7a Factor CSS3 matching rules.
This factors out the CSS3 matching rules, creates tests for it,
and uses it with the GDI font manager.

BUG=chromium:554238,skia:4037

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

Review URL: https://codereview.chromium.org/1438113002
2015-11-12 09:50:08 -08:00
cdalton
7e806f3f8a Revert of Enable stencil clipping in mixed sampled render targets (patchset #6 id:100001 of https://codereview.chromium.org/1232103002/ )
Reason for revert:
Co-centered sample locations are not needed to do stencil clip with mixed samples

Original issue's description:
> Implement stencil clipping in mixed sampled render targets
>
> This change enables multisampled clipping for mixed sampled
> render targets.  Previously clipping in mixed samples config
> behaved the same as in the gpu config.
>
> In order to retrofit non-MSAA draw methods, programmable sample
> locations are used in order to colocate all samples at (0.5, 0.5).
> Requires support for NV_sample_locations.
>
> BUG=skia:4399
>
> Committed:
> https://skia.googlesource.com/skia/+/3e77ba96d56d15db30ac6d8ccb900e30aafcbb16

BUG=skia:

Review URL: https://codereview.chromium.org/1415873011
2015-11-11 15:16:07 -08:00
cdalton
24ddb0a4dd Revert of Fix setColocatedSampleLocations on ES and GL < 4.5 (patchset #2 id:20001 of https://codereview.chromium.org/1415503008/ )
Reason for revert:
Co-centered sample locations are not needed to do stencil clip with mixed samples.

Original issue's description:
> Fix setColocatedSampleLocations on ES and GL < 4.5
>
> Updates setColocatedSampleLocations to use glFramebufferParameteri
> when
> the DSA version glNamedFramebufferParameteri is not present.
>
> BUG=skia:
>
> Committed:
> https://skia.googlesource.com/skia/+/98cad6219b430eddf5528473311279f21dbd2e10

BUG=skia:

Review URL: https://codereview.chromium.org/1420883007
2015-11-11 15:03:46 -08:00
robertphillips
caef345048 Readd "immediate" mode
This isn't an exact replacement. The accumulated batches are now flushed at drawContext-entry-point granularity (via the AutoCheckFlush objects) rather than per batch.

TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/1439533003
2015-11-11 13:18:11 -08:00
msarett
33bee090fa Fix -Wunused-parameter errors in SkCodec.h in Android
BUG=skia:

Review URL: https://codereview.chromium.org/1437823004
2015-11-11 12:43:07 -08:00
robertphillips
a13e202563 Move GrBatchFlushState from GrDrawTarget to GrDrawingManager
This CL:
  moves the flushState
  disables immediate mode (it was proving difficult to implement)
  also moves the program unit test to the drawing manager

BUG=skia:4094
TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/1437843002
2015-11-11 12:01:09 -08:00
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
cdalton
d472792a72 Revert of Fix mixed samples stencil clip (patchset #5 id:80001 of https://codereview.chromium.org/1431593006/ )
Reason for revert:
Co-centered sample locations are not needed to do stencil clip with mixed samples.

Original issue's description:
> Fix mixed samples stencil clip
>
> Fixes rendering bugs and nondeterminism in gm.
>
> Before, mixed samples stencil clip would try to infer whether the draw
> wanted co-centered sample locations from within GrGLGpu, which caused
> various errors. This change reworks it so the draw itself can request
> the co-centered sample locations when it knows it will need them.
>
> Also reduces framebuffer binds by moving the code that enables
> GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS into flushRenderTarget.
>
> Committed: https://skia.googlesource.com/skia/+/14184d5567b58085b6d8a6375796d405056f7f73

TBR=bsalomon@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1407063011
2015-11-10 12:49:06 -08:00
bsalomon
091f60c2a0 Use a struct for client GL texture handles
Review URL: https://codereview.chromium.org/1429863009
2015-11-10 11:54:57 -08:00
reed
d9ffaed6d2 apply mozilla patch
BUG=skia:4547

Review URL: https://codereview.chromium.org/1421793009
2015-11-10 04:55:08 -08:00
cdalton
14184d5567 Fix mixed samples stencil clip
Fixes rendering bugs and nondeterminism in gm.

Before, mixed samples stencil clip would try to infer whether the draw
wanted co-centered sample locations from within GrGLGpu, which caused
various errors. This change reworks it so the draw itself can request
the co-centered sample locations when it knows it will need them.

Also reduces framebuffer binds by moving the code that enables
GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS into flushRenderTarget.

Review URL: https://codereview.chromium.org/1431593006
2015-11-09 15:12:19 -08:00
jvanverth
629162dd8e Add text animation sample; tweak DrawShip sample
Committed: https://skia.googlesource.com/skia/+/3b484a40b3be7f0262afadeaf6b741ba5cedcfe1

Review URL: https://codereview.chromium.org/1410663005
2015-11-08 08:07:24 -08:00
jvanverth
d75ccc6a0a Revert of Add text animation sample; tweak DrawShip sample (patchset #3 id:40001 of https://codereview.chromium.org/1410663005/ )
Reason for revert:
CrOS bots failing.

Original issue's description:
> Add text animation sample; tweak DrawShip sample
>
> Committed: https://skia.googlesource.com/skia/+/3b484a40b3be7f0262afadeaf6b741ba5cedcfe1

TBR=robertphillips@google.com,bsalomon@google.com,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1408063015
2015-11-06 16:10:34 -08:00
jvanverth
3b484a40b3 Add text animation sample; tweak DrawShip sample
Review URL: https://codereview.chromium.org/1410663005
2015-11-06 14:20:04 -08:00
cdalton
63f6c1fc5b Loosen requirements for mixed samples support
Quits requiring EXT_raster_multisample and
NV_sample_mask_override_coverage for mixed samples support. This will
allow platforms without those latter extensions (i.e. Chrome) to still
use mixed samples for path rendering. Also moves the mixed samples cap
out of shader caps, since it no longer denotes shader functionality.

BUG=skia:

Review URL: https://codereview.chromium.org/1410383011
2015-11-06 07:09:43 -08:00
joshualitt
474a9ea051 Wire up SDL on Android
BUG=skia:

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

Review URL: https://codereview.chromium.org/1415453009
2015-11-05 11:49:35 -08:00
joshualitt
5d7a7fe563 Revert of Wire up SDL on Android (patchset #4 id:60001 of https://codereview.chromium.org/1415453009/ )
Reason for revert:
breaks appurify

Original issue's description:
> Wire up SDL on Android
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/a4d3797c3b0f0cac8493c46cb334ca88a5d6ccf6

TBR=bsalomon@google.com,robertphillips@google.com,joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1410703009
2015-11-05 10:48:41 -08:00
bsalomon
a2e69fcded Rename non-aa rect methods on GrDrawContext in anticipation of making them support aa
R=joshualitt@google.com

Review URL: https://codereview.chromium.org/1409753008
2015-11-05 10:41:43 -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
joshualitt
a4d3797c3b Wire up SDL on Android
BUG=skia:

Review URL: https://codereview.chromium.org/1415453009
2015-11-05 08:35:31 -08:00
joshualitt
65d6fbb576 Create SDL backed SkOSWindow
BUG=skia:

Review URL: https://codereview.chromium.org/1413593007
2015-11-04 13:41:02 -08:00
scroggo
e95a06883b Make AndroidOptions const
Make the struct passed to SkAndroidCodec::getAndroidPixels const. This
matches SkCodec, and makes sense, since it is not used as an output.

Brought up in crrev.com/1417583009

Review URL: https://codereview.chromium.org/1411693005
2015-11-04 04:31:12 -08:00
egdaniel
b7e7d5748d Create swizzle table inside of glsl caps
BUG=skia:

Committed: https://skia.googlesource.com/skia/+/4036674952f341dab0695c3b054fefa5bb8cdec1

Review URL: https://codereview.chromium.org/1420033005
2015-11-04 04:23:53 -08:00
egdaniel
0c2999974d Revert of Create swizzle table inside of glsl caps (patchset #12 id:210001 of https://codereview.chromium.org/1420033005/ )
Reason for revert:
Breaking gm's on nexus7 and s3

Original issue's description:
> Create swizzle table inside of glsl caps
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/4036674952f341dab0695c3b054fefa5bb8cdec1

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

Review URL: https://codereview.chromium.org/1426653008
2015-11-03 10:33:14 -08:00
cdalton
98cad6219b Fix setColocatedSampleLocations on ES and GL < 4.5
Updates setColocatedSampleLocations to use glFramebufferParameteri when
the DSA version glNamedFramebufferParameteri is not present.

BUG=skia:

Review URL: https://codereview.chromium.org/1415503008
2015-11-03 09:33:21 -08:00
egdaniel
4036674952 Create swizzle table inside of glsl caps
BUG=skia:

Review URL: https://codereview.chromium.org/1420033005
2015-11-03 08:15:29 -08:00
bsalomon
8c07b7ab53 Allow max tile size to be overridden separately from max texture size.
This allows internal Gr texture creation code to succeed for extraneous textures while running the bleed GM. This means we can turn on the shader variants.

Review URL: https://codereview.chromium.org/1418473004
2015-11-02 11:36:52 -08:00
robertphillips
498d7ac86b Dependencies are now added between the drawTargets in GrPipeline
This CL relies on https://codereview.chromium.org/1414773002/ (Add the machinery to GrDrawTarget to enable topological sorting)

BUG=skia:4094

Committed: https://skia.googlesource.com/skia/+/45a1c34f607a970933e5cd05e1df6cd8090db1be

Committed: https://skia.googlesource.com/skia/+/869c5e82a725a6928a45cd1fa6945ac783b8b3d8

Review URL: https://codereview.chromium.org/1414903002
2015-10-30 10:11:30 -07: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
robertphillips
687378229a Remove GrPipelineBuilder from getPathRenderer call
Logically this CL:

Moves the PathRendererChain from GrContext to GrDrawManager
   - this was needed to untangled the Path-Chain/Renderer header mess
   - this entailed adding getDrawingMgr so the CMM could access the PathRenderingChain
   - this also entailed re-adding freeGpuResources to the GrDrawingMgr
Moves the CanDrawArgs struct up stack
Removes the GrPipelineBuilder from the CanDrawArgs struct

Review URL: https://codereview.chromium.org/1407883004
2015-10-29 12:12:21 -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
hendrikw
9a7404188e skia: Add ANGLE support on Mac
I want to be able to compare ANGLE vs CommandBuffer for
dm and nanobench on Mac, so enabling ANGLE on mac.

Review URL: https://codereview.chromium.org/1395783003
2015-10-28 08:42:29 -07:00
bsalomon
100b8f8c07 Remove min texture size support
BUG=skia:4524

Review URL: https://codereview.chromium.org/1430643002
2015-10-28 08:37:44 -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
robertphillips
cf10b5a432 Cosmetic portion of reverted "Fix ClipMaskManager's SW-fallback logic" CL
This CL isolates the cosmetic portion so the functional portion is clearer. It relies on https://codereview.chromium.org/1412883005/ (Fix ClipMaskManager's SW-fallback logic (take 2))

Review URL: https://codereview.chromium.org/1422023003
2015-10-27 07:53:35 -07:00
robertphillips
24cdec1744 Revert of Fix ClipMaskManager's SW-fallback logic (patchset #4 id:60001 of https://codereview.chromium.org/1421533007/ )
Reason for revert:
Logic may be incorrect

Original issue's description:
> Fix ClipMaskManager's SW-fallback logic
>
>
> 'useSWOnlyPath' was not correctly toggling between stencil and color draws so there was a mismatch with the behavior in createAlphaClipMask (i.e., we were inadvertently rendering some of the elements in a clip using SW but using stenciling for others - precisely what 'useSWOnlyPath' was intended to prevent).
>
> Committed: https://skia.googlesource.com/skia/+/5c3ea4cd3921e8904d4f201bcdedfd5b8a726542

TBR=bsalomon@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1426443008
2015-10-26 14:12:25 -07:00
robertphillips
5c3ea4cd39 Fix ClipMaskManager's SW-fallback logic
'useSWOnlyPath' was not correctly toggling between stencil and color draws so there was a mismatch with the behavior in createAlphaClipMask (i.e., we were inadvertently rendering some of the elements in a clip using SW but using stenciling for others - precisely what 'useSWOnlyPath' was intended to prevent).

Review URL: https://codereview.chromium.org/1421533007
2015-10-26 08:33:10 -07:00
joshualitt
6df232d251 Revert of Experimental CL to stop using subdata (patchset #1 id:1 of https://codereview.chromium.org/1413263006/ )
Reason for revert:
might be breaking tsan

Original issue's description:
> Experimental CL to stop using subdata
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/383ce32e3e5ca0c8997ece827205f61d348ee56f

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

Review URL: https://codereview.chromium.org/1409123004
2015-10-23 13:54:12 -07:00
herb
546dc3294d Use SkAutoTExclusive guard in DirectWrite port.
Review URL: https://codereview.chromium.org/1417873005
2015-10-23 10:48:26 -07:00
robertphillips
b83bec5e04 Narrow the distribution of GrDrawTarget a bit
BUG=skia:4094
TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/1420043002
2015-10-23 09:38:03 -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
joshualitt
383ce32e3e Experimental CL to stop using subdata
BUG=skia:

Review URL: https://codereview.chromium.org/1413263006
2015-10-23 09:12:02 -07:00
bsalomon
648c696438 Add immediate mode option for gpu configs in dm
Review URL: https://codereview.chromium.org/1421853002
2015-10-23 09:06:59 -07:00
joshualitt
ccdbc1d062 Remove mac buffer impl war
BUG=skia:

Review URL: https://codereview.chromium.org/1419203002
2015-10-23 07:33:54 -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
robertphillips
a352b14c87 Revert of Dependencies are now added between the drawTargets in GrPipeline (patchset #6 id:120001 of https://codereview.chromium.org/1414903002/ )
Reason for revert:
Breaking bots

Original issue's description:
> Dependencies are now added between the drawTargets in GrPipeline
>
> This CL relies on https://codereview.chromium.org/1414773002/ (Add the machinery to GrDrawTarget to enable topological sorting)
>
> BUG=skia:4094
>
> Committed: https://skia.googlesource.com/skia/+/45a1c34f607a970933e5cd05e1df6cd8090db1be
>
> Committed: https://skia.googlesource.com/skia/+/869c5e82a725a6928a45cd1fa6945ac783b8b3d8

TBR=bsalomon@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:4094

Review URL: https://codereview.chromium.org/1417263002
2015-10-22 05:31:32 -07:00
robertphillips
869c5e82a7 Dependencies are now added between the drawTargets in GrPipeline
This CL relies on https://codereview.chromium.org/1414773002/ (Add the machinery to GrDrawTarget to enable topological sorting)

BUG=skia:4094

Committed: https://skia.googlesource.com/skia/+/45a1c34f607a970933e5cd05e1df6cd8090db1be

Review URL: https://codereview.chromium.org/1414903002
2015-10-22 05:19:50 -07:00
herb
12449a9614 Add lighter weight lock guards.
BUG=skia:

Review URL: https://codereview.chromium.org/1417583005
2015-10-21 19:11:13 -07:00