Commit Graph

4234 Commits

Author SHA1 Message Date
halcanary
c2574f3657 Revert of XPS, DM: add SkDocument::CreateXPS (patchset #8 id:310001 of https://codereview.chromium.org/963953002/)
Reason for revert:
breaking iOS build.

Original issue's description:
> XPS, DM: add SkDocument::CreateXPS
>
> -   SkDocument::CreateXPS() function added, returns NULL on non-Windows OS.
>
> -   DM: (Windows only) an XPSSink is added, fails on non-Windows OS
>
> -   DM: Common code for PDFSink::draw and XPSSink::draw are factored into
>     draw_skdocument static function.
>
> -   SkDocument_XPS (Windows only) implementation of SkDocument via
>     SkXPSDevice.
>
> -   SkDocument_XPS_None (non-Windows) returns NULL for
>     SkDocument::CreateXPS().
>
> -   gyp/xps.gyp refactored.
>
> -   SkXPSDevice::drawTextOnPath removed (see http://crrev.com/925343003 )
>
> -   SkXPSDevice::drawPath supports conics via SkAutoConicToQuads.
>
> NOPRESUBMIT=true
>
> Committed: https://skia.googlesource.com/skia/+/00d39bcbfc8394a9b48b86b04ab06ec19091fa43

TBR=reed@google.com,bungeman@google.com,mtklein@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/978443002
2015-03-03 08:34:14 -08:00
halcanary
00d39bcbfc XPS, DM: add SkDocument::CreateXPS
-   SkDocument::CreateXPS() function added, returns NULL on non-Windows OS.

-   DM: (Windows only) an XPSSink is added, fails on non-Windows OS

-   DM: Common code for PDFSink::draw and XPSSink::draw are factored into
    draw_skdocument static function.

-   SkDocument_XPS (Windows only) implementation of SkDocument via
    SkXPSDevice.

-   SkDocument_XPS_None (non-Windows) returns NULL for
    SkDocument::CreateXPS().

-   gyp/xps.gyp refactored.

-   SkXPSDevice::drawTextOnPath removed (see http://crrev.com/925343003 )

-   SkXPSDevice::drawPath supports conics via SkAutoConicToQuads.

NOPRESUBMIT=true

Review URL: https://codereview.chromium.org/963953002
2015-03-03 08:26:00 -08:00
reed
cff10b21a9 change colorfilter to return an array of frag processors
BUG=skia:

Review URL: https://codereview.chromium.org/973593002
2015-03-03 06:41:45 -08:00
reed
8a8d841d48 add virtuals to optimize composing colorfilters
BUG=skia:

Review URL: https://codereview.chromium.org/968993004
2015-03-02 13:46:03 -08:00
scroggo
ee1a726aed Revert of Add SkCodec, including PNG implementation. (patchset #24 id:460001 of https://codereview.chromium.org/930283002/)
Reason for revert:
Breaking windows bots all over the place :(

Original issue's description:
> Add SkCodec, including PNG implementation.
>
> DM:
> Add a flag to use SkCodec instead of SkImageDecoder.
>
> SkCodec:
> Base class for codecs, allowing creation from an SkStream or an SkData.
> An SkCodec, on creation, knows properties of the data like its width and height. Further calls can be used to generate the image.
> TODO: Add scanline iterator
>
> SkPngCodec:
> New decoder for png. Wraps libpng. The code has been repurposed from SkImageDecoder_libpng.
> TODO: Handle other destination colortypes
> TODO: Substitute the transpose color
> TODO: Allow silencing warnings
> TODO: Use RGB instead of filler?
> TODO: sRGB
>
> SkSwizzler:
> Simplified version of SkScaledSampler. Unlike the sampler, this object does no sampling.
> TODO: Implement other swizzles.
>
> BUG=skia:3257
>
> Committed: https://skia.googlesource.com/skia/+/ca358852b4fed656d11107b2aaf28318a4518b49

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

Review URL: https://codereview.chromium.org/972743003
2015-03-02 12:31:12 -08:00
scroggo
ca358852b4 Add SkCodec, including PNG implementation.
DM:
Add a flag to use SkCodec instead of SkImageDecoder.

SkCodec:
Base class for codecs, allowing creation from an SkStream or an SkData.
An SkCodec, on creation, knows properties of the data like its width and height. Further calls can be used to generate the image.
TODO: Add scanline iterator

SkPngCodec:
New decoder for png. Wraps libpng. The code has been repurposed from SkImageDecoder_libpng.
TODO: Handle other destination colortypes
TODO: Substitute the transpose color
TODO: Allow silencing warnings
TODO: Use RGB instead of filler?
TODO: sRGB

SkSwizzler:
Simplified version of SkScaledSampler. Unlike the sampler, this object does no sampling.
TODO: Implement other swizzles.

BUG=skia:3257

Review URL: https://codereview.chromium.org/930283002
2015-03-02 12:23:48 -08:00
huangs
9345eef3a0 [Skia] Add SK_API to SkParse.
For https://codereview.chromium.org/924063003/ , we would like to use the
SkParse::FindColor().  Adding SK_API to SkParse is necessary for component
build to work.

BUG=skia:

Review URL: https://codereview.chromium.org/971623003
2015-03-02 07:51:17 -08:00
reed
db873d8677 add compose-colorfilter
now with serialization registration

This reverts commit 5bd055c038.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/970753002
2015-03-01 19:53:47 -08:00
reed
5bd055c038 Revert of add compose-colorfilter (patchset #2 id:20001 of https://codereview.chromium.org/969673002/)
Reason for revert:
need to register subclass for serialization

Original issue's description:
> add compose-colorfilter
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/b675a73c1f3f4a433c4893199a0bd11126dfe130

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

Review URL: https://codereview.chromium.org/971653002
2015-03-01 19:16:38 -08:00
reed
b675a73c1f add compose-colorfilter
BUG=skia:

Review URL: https://codereview.chromium.org/969673002
2015-03-01 18:00:47 -08:00
reed
44977485bd Revert of Revert of replace kIgnore_SkAlphaType with kUnknown_SkAlphaType (patchset #1 id:1 of https://codereview.chromium.org/966753002/)
Reason for revert:
Android has been updated, so we can re-land this.

Original issue's description:
> Revert of replace kIgnore_SkAlphaType with kUnknown_SkAlphaType (patchset #3 id:40001 of https://codereview.chromium.org/964613002/)
>
> Reason for revert:
> This breaks Android framework build. See
>
> 7f0fcdbf3c/logs/build_error.log
>
> We need to stop them from using kIgnore before we can reland this.
>
> Original issue's description:
> > replace kIgnore_SkAlphaType with kUnknown_SkAlphaType
> >
> > BUG=skia:
> > TBR=
> >
> > Committed: https://skia.googlesource.com/skia/+/1c8aeeaebce9675197be31bd769e8ffa2531bf86
>
> TBR=reed@google.com,reed@chromium.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/574290f61a47bd1ce1f9e2d941533bda9c8f03fe

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

Review URL: https://codereview.chromium.org/966853002
2015-02-27 10:23:00 -08:00
robertphillips
a9061de9ff Add rewind capability to SkChunkAlloc
Split off from https://codereview.chromium.org/940533003/ (Decrease GrInOrderDrawBuffer::Cmd's reliance on GrInOrderDrawBuffer)

Review URL: https://codereview.chromium.org/967553003
2015-02-27 08:31:57 -08:00
scroggo
574290f61a Revert of replace kIgnore_SkAlphaType with kUnknown_SkAlphaType (patchset #3 id:40001 of https://codereview.chromium.org/964613002/)
Reason for revert:
This breaks Android framework build. See

7f0fcdbf3c/logs/build_error.log

We need to stop them from using kIgnore before we can reland this.

Original issue's description:
> replace kIgnore_SkAlphaType with kUnknown_SkAlphaType
>
> BUG=skia:
> TBR=
>
> Committed: https://skia.googlesource.com/skia/+/1c8aeeaebce9675197be31bd769e8ffa2531bf86

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

Review URL: https://codereview.chromium.org/966753002
2015-02-27 06:21:58 -08:00
reed
1c8aeeaebc replace kIgnore_SkAlphaType with kUnknown_SkAlphaType
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/964613002
2015-02-27 06:00:33 -08:00
mtklein
e76161458a Spin off some fixes to land right away.
BUG=skia:

Review URL: https://codereview.chromium.org/960023002
2015-02-26 10:14:15 -08:00
joshualitt
570d2f81a6 I'd really like to land this before the branch so speedy reviews are appreciated.
BUG=skia:

Committed: https://skia.googlesource.com/skia/+/586d5d640b19860dfbbd903a5188da1bbbe87336

Review URL: https://codereview.chromium.org/936943002
2015-02-25 13:19:48 -08:00
joshualitt
2907059d0e Revert of Pass clip to context (patchset #8 id:180001 of https://codereview.chromium.org/936943002/)
Reason for revert:
Strange blur problems on nexus 5

Original issue's description:
> I'd really like to land this before the branch so speedy reviews are appreciated.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/586d5d640b19860dfbbd903a5188da1bbbe87336

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

Review URL: https://codereview.chromium.org/956083002
2015-02-25 13:04:44 -08:00
mtklein
edeccc5860 Clean up ColorRectProc plumbing.
We've always been using the portable ColorRect32, so we don't need the
ColorRectProc plumbing.

Furthermore, ColorRect32 doesn't seem to be very important (we're only using
it in the opaque case, which our row-by-row procs already specialize for).
Remove that too.

If we find we want specialization for really narrow rects again, let's put it in
blitRect() directly.  It's pretty unlikely we're going to get platform-specific
speedup for blits to non-contiguous memory.

My local SKP comparison is +- 3%... most neutral I've ever seen.

BUG=skia:

Review URL: https://codereview.chromium.org/959873002
2015-02-25 12:52:57 -08:00
mtklein
59c9203321 Fix the race to set the new gen ID.
There's a small window where two threads can both see the gen ID is zero,
both go get new distinct genIDs, but race to write them.

This now uses compare_exchange to read and leave the winner's ID in place
when there's a race.

SkAtomics isn't public.
TBR=reed@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/956013002
2015-02-25 12:51:55 -08:00
joshualitt
586d5d640b I'd really like to land this before the branch so speedy reviews are appreciated.
BUG=skia:

Review URL: https://codereview.chromium.org/936943002
2015-02-25 11:21:21 -08:00
mtklein
63d0024cde Steal a bit from the gen ID instead of managing two atomic values.
This extra atomic bool is hard to think about, and I'm worried about how
updates to fGenerationID and fUniqueGenerationID interlace.  By storing
them in the same int, they can't ever race.

CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu13.10-GCE-NoGPU-x86_64-Release-TSAN-Trybot

BUG=skia:

Review URL: https://codereview.chromium.org/955043002
2015-02-25 09:10:57 -08:00
caryclark
63c684a8a6 fuzzer fixes
Fix path bugs exposed by the path fuzzer.

Changes to existing gm and samplecode files defer their calls to construct
SkPath objects until the first draw instead of at test initialization.

Add an experimental call to SkPath to validate the internal SkPathRef.

Fix SkPath::addPoly to set the last moveto after adding a close verb.

Fix stroke to handle failures when computing the unit normal.

Add a unit test for the unit normal failure.

R=reed@google.com

Review URL: https://codereview.chromium.org/953383002
2015-02-25 09:04:04 -08:00
mtklein
61010772e5 Revert of fAddedToCache doesn't need to be atomic. (patchset #1 id:1 of https://codereview.chromium.org/960573002/)
Reason for revert:
Yes it does.  notifyAddedToCache() must be thread-safe.

Original issue's description:
> fAddedToCache doesn't need to be atomic.
>
> It's only ever read or set from non-threadsafe methods.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/fbe0edfec4fed2a09e12b049d527d280f16e75b3

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

Review URL: https://codereview.chromium.org/959763002
2015-02-25 08:27:41 -08:00
mtklein
fbe0edfec4 fAddedToCache doesn't need to be atomic.
It's only ever read or set from non-threadsafe methods.

BUG=skia:

Review URL: https://codereview.chromium.org/960573002
2015-02-25 08:11:18 -08:00
reed
83787d0ff0 only notify bitmaps that have been added to the cache
old code:
- calls=2677 hit-rate=3.51139%

new code:
- calls=94 hit-rate=97.8723%

BUG=skia:

Review URL: https://codereview.chromium.org/960563002
2015-02-25 07:17:11 -08:00
herb
b69d0e0ac4 BUG=skia:
(mtklein from here on)
No public API changes.
TBR=reed@google.com

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

Review URL: https://codereview.chromium.org/939123002
2015-02-25 06:47:06 -08:00
mtklein
86821b5670 SkTRacy<T> -> SkAtomic<T>
Like SkTRacy<T>, TSAN will not complain about these.  Unlike SkTRacy<T>, TSAN
should not complain about these: SkAtomic<T> are threadsafe.

This should fix the races now suppressed in TSAN.  As written, the memory
barriers we're using in SkPixelRef will be dumb but safe (really, dumbest
possible but safest possible).  If we see a perf hit, we can follow up by
putting Ben and I in a room for a while, thinking about it really hard, and
using the minimum-strength safe memory barriers.

A refactor that steals a bit from the genID would also still be possible with
this approach.

BUG=chromium:437511

CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu13.10-GCE-NoGPU-x86_64-Release-TSAN-Trybot

Review URL: https://codereview.chromium.org/955803002
2015-02-24 14:38:12 -08:00
joshualitt
ab2f44cbfa probable fix for asan bot
NOTREECHECKS=True
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/956583002
2015-02-24 06:47:14 -08:00
scroggo
e59bbf1cd5 Revert of Make fID and MixedID calculations private (patchset #5 id:80001 of https://codereview.chromium.org/939123002/)
Reason for revert:
This actually *does* change the public API - fID is now private, and it was being used on Android. See 5242b865d3/logs/build.log :

In file included from frameworks/base/libs/hwui/tests/../font/Font.cpp:26:0:
external/skia/src/core/SkGlyph.h: In member function 'android::uirenderer::CachedGlyphInfo* android::uirenderer::Font::cacheGlyph(const SkPaint*, glyph_t, bool)':
external/skia/src/core/SkGlyph.h:157:17: error: 'uint32_t SkGlyph::fID' is private
     uint32_t    fID;
                 ^
frameworks/base/libs/hwui/tests/../font/Font.cpp:482:39: error: within this context
     newGlyph->mGlyphIndex = skiaGlyph.fID;

We need to update Android in order to hide fID.

Original issue's description:
> BUG=skia:
>
> (mtklein from here on)
> No public API changes.
> TBR=reed@google.com
>
> Committed: https://skia.googlesource.com/skia/+/f8d24e2c0c7b44b7ccf20e40890514db4cde7b15

TBR=mtklein@google.com,herb@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/951353002
2015-02-24 06:09:41 -08:00
herb
f8d24e2c0c BUG=skia:
(mtklein from here on)
No public API changes.
TBR=reed@google.com

Review URL: https://codereview.chromium.org/939123002
2015-02-24 05:12:05 -08:00
joshualitt
0413d43e1b Enable rect clips
BUG=skia:

Review URL: https://codereview.chromium.org/951653002
2015-02-23 17:52:51 -08:00
joshualitt
9ece6a9548 move static init to cpp file to fix linux builder
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/947933004
2015-02-23 17:03:33 -08:00
joshualitt
128def3900 Revert of fix for linux builder warn on exit destructor (patchset #1 id:1 of https://codereview.chromium.org/951103002/)
Reason for revert:
still breaks

Original issue's description:
> fix for linux builder warn on exit destructor
>
> TBR=bsalomon@google.com
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/51fdb4f8f63b6bb13e719000381e225503a2d4a0

TBR=joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/955493003
2015-02-23 16:19:22 -08:00
joshualitt
51fdb4f8f6 fix for linux builder warn on exit destructor
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/951103002
2015-02-23 15:57:23 -08:00
joshualitt
44701df5ce Move clip off of draw target
BUG=skia:

Review URL: https://codereview.chromium.org/947443003
2015-02-23 14:44:58 -08:00
halcanary
7af21501a6 SkStream: Add SkDynamicMemoryWStream::writeToStream(SkWStream*)
Review URL: https://codereview.chromium.org/943423002
2015-02-23 12:18:00 -08:00
egdaniel
0bdeec9640 Remove canApplyCoverage from XP and all related functions in gpu code.
BUG=skia:

Review URL: https://codereview.chromium.org/919683002
2015-02-23 12:12:54 -08:00
bsalomon
93276c683d Remove EGL header from SkANGLELContext.h
TBR=egdaniel@google.com

Review URL: https://codereview.chromium.org/947263002
2015-02-23 10:51:13 -08:00
bsalomon
c01f47b759 Remove unnecessary include of gles2 header in SkANGLEGLContext.h
TBR=robertphillips@google.com

Review URL: https://codereview.chromium.org/949973002
2015-02-23 10:06:44 -08:00
bsalomon
6bc1b5fab8 Dynamically create stencil buffer when needed.
Review URL: https://codereview.chromium.org/938383004
2015-02-23 09:06:38 -08:00
bsalomon
42380174ca Use D3D11 backend for ANGLE when available.
Review URL: https://codereview.chromium.org/954453002
2015-02-23 08:57:23 -08:00
bungeman
7be2eb89cc Remove SkFontHost includes and friends.
SkFontHost no longer exists as a class, so remove the includes and stop
making it a friend.

Review URL: https://codereview.chromium.org/943333004
2015-02-23 08:25:00 -08:00
scroggo
953df445ab Remove SK_SUPPORT_LEGACY_GET_PIXELS_ENUM.
SK_SUPPORT_LEGACY_GET_PIXELS_ENUM just set a \#define to convert
onGetPixelsEnum
to
onGetPixels

Now that Chrome has been updated to override onGetPixels, there is no
need for the define.

BUG=skia:3257

Review URL: https://codereview.chromium.org/933853004
2015-02-23 07:07:25 -08:00
kkinnunen
abcfab4d68 Swap render target instead of creating a new gpu device for surface copy-on-write
Swap render target of the gpu device instead of creating a new gpu
device when making a copy-on-write upon surface modification.

This removes the SkCanvas::setRootDevice which contains problematic code
when trying to increase the use of SkImages internally in Skia.

BUG=skia:3388

Review URL: https://codereview.chromium.org/925343002
2015-02-22 22:53:44 -08:00
fmalita
7a048690d3 [SVGDevice] Text whitespace unittest
Plumb SkDOM as needed to make it suitable for an SkXMLWriter backend.

Also fix a potential null typeface issue in
SkSVGDevice::AutoElement::addTextAttributes().

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

Review URL: https://codereview.chromium.org/940283002
2015-02-20 13:54:40 -08:00
mtklein
96d68b7046 Make SkPixelRef::isLocked() debug-only, remove related dead code.
DM's okay locally with no diffs, no failures.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/8e65712486c66108677a9b0a55ad3e7ca94db555

Review URL: https://codereview.chromium.org/940083002
2015-02-20 12:40:40 -08:00
djsollen
7ff705023d Enable override keyword for GCC versions >= 4.7
Review URL: https://codereview.chromium.org/945803005
2015-02-20 12:35:37 -08:00
reed
b92b706dfd Revert of Make SkPixelRef::isLocked() debug-only, remove related dead code. (patchset #1 id:1 of https://codereview.chromium.org/940083002/)
Reason for revert:
Broke callers in chrome

../../skia/ext/platform_canvas_unittest.cc:421:56: error: no member named 'isLocked' in 'SkPixelRef'
  EXPECT_TRUE(platform_bitmap->GetBitmap().pixelRef()->isLocked());

Original issue's description:
> Make SkPixelRef::isLocked() debug-only, remove related dead code.
>
> DM's okay locally with no diffs, no failures.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/8e65712486c66108677a9b0a55ad3e7ca94db555

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

Review URL: https://codereview.chromium.org/940323003
2015-02-19 20:00:33 -08:00
halcanary
8c92dc1dc2 Remove unused parameters to SkDocument::CreatePDF
All image compression currently uses (losseless) Deflate, not Jpeg.

All clients simply use SkDocument::CreatePDF(stream).

SampleApp and SkLua still use SkDocument::CreatePDF(path).

Review URL: https://codereview.chromium.org/935843007
2015-02-19 18:50:05 -08:00
mtklein
8e65712486 Make SkPixelRef::isLocked() debug-only, remove related dead code.
DM's okay locally with no diffs, no failures.

BUG=skia:

Review URL: https://codereview.chromium.org/940083002
2015-02-19 18:50:00 -08:00