Commit Graph

2896 Commits

Author SHA1 Message Date
kkinnunen
d156d36af8 Make GrStrokeInfo inherit from SkStrokeRec
Make the code more readable by inheriting GrStrokeInfo from SkStrokeRec.
This should avoid the long .getStrokeRec() and .getStrokeRecPtr(). These
were a bit cumbersome especially in cases where an alias variable was
created for these, and then the reader had to keep track to which
StrokeInfo member the StrokeRec alias was pointing.

Removes SkStrokeRec::SkStrokeRec(const SkStrokeRec&). It was memcpying.
Try to play it safe wrt compiler using the possible padding of
superclass for subclass members. Instead, let the compiler generate
the copy constructor. Assignment operator was already
compiler-generated, so at least in that way this is consistent.

Renames GrStrokeInfo::applyDash to applyDashToPath for consistency
with superclass applyToPath.

Review URL: https://codereview.chromium.org/1128113008
2015-05-18 22:23:54 -07:00
mtklein
72743b1654 Revert of Sketch splitting SkPicture into an interface and SkBigPicture. (patchset #25 id:480001 of https://codereview.chromium.org/1112523006/)
Reason for revert:
win_chromium_compile_dbg_ng

FAILED: ninja -t msvc -e environment.x86 -- E:\b\build\goma/gomacc "E:\b\depot_tools\win_toolchain\vs2013_files\VC\bin\amd64_x86\cl.exe" /nologo /showIncludes /FC @obj\third_party\skia\src\core\skia.SkBitmapHeap.obj.rsp /c ..\..\third_party\skia\src\core\SkBitmapHeap.cpp /Foobj\third_party\skia\src\core\skia.SkBitmapHeap.obj /Fdobj\skia\skia.cc.pdb
e:\b\build\slave\win\build\src\third_party\skia\include\core\skpicture.h(176) : error C2487: 'CURRENT_PICTURE_VERSION' : member of dll interface class may not be declared with dll interface

Original issue's description:
> Sketch splitting SkPicture into an interface and SkBigPicture.
>
> Adds small pictures for drawRect(), drawTextBlob(), and drawPath().
> These cover about 89% of draw calls from Blink SKPs,
> and about 25% of draw calls from our GMs.
>
> SkPicture handles:
>   - serialization and deserialization
>   - unique IDs
>
> Everything else is left to the subclasses:
>   - playback(), cullRect()
>   - hasBitmap(), hasText(), suitableForGPU(), etc.
>   - LayerInfo / AccelData if applicable.
>
> The time to record a 1-op picture improves a good chunk
> (2 mallocs to 1), and the time to record a 0-op picture
> greatly improves (2 mallocs to none):
>
>     picture_overhead_draw:   450ns -> 350ns
>     picture_overhead_nodraw: 300ns -> 90ns
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/c92c129ff85b05a714bd1bf921c02d5e14651f8b
>
> Latest blink_linux_rel:
>
> http://build.chromium.org/p/tryserver.blink/builders/linux_blink_rel/builds/61248
>
> Committed: https://skia.googlesource.com/skia/+/15877b6eae33a9282458bdb904a6d00440eca0ec

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

Review URL: https://codereview.chromium.org/1130283004
2015-05-18 14:53:43 -07:00
mtklein
15877b6eae Sketch splitting SkPicture into an interface and SkBigPicture.
Adds small pictures for drawRect(), drawTextBlob(), and drawPath().
These cover about 89% of draw calls from Blink SKPs,
and about 25% of draw calls from our GMs.

SkPicture handles:
  - serialization and deserialization
  - unique IDs

Everything else is left to the subclasses:
  - playback(), cullRect()
  - hasBitmap(), hasText(), suitableForGPU(), etc.
  - LayerInfo / AccelData if applicable.

The time to record a 1-op picture improves a good chunk
(2 mallocs to 1), and the time to record a 0-op picture
greatly improves (2 mallocs to none):

    picture_overhead_draw:   450ns -> 350ns
    picture_overhead_nodraw: 300ns -> 90ns

BUG=skia:

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

Latest blink_linux_rel:

http://build.chromium.org/p/tryserver.blink/builders/linux_blink_rel/builds/61248

Review URL: https://codereview.chromium.org/1112523006
2015-05-18 13:47:17 -07:00
robertphillips
465706820d Revert of Font variations. (patchset #26 id:500001 of https://codereview.chromium.org/1027373002/)
Reason for revert:
Appears to be breaking  Linux ARM bots:

FAILED:
/usr/local/google/home/mosaic-role/slave/repo_clients/chromium_tot/chromium/src/../../prebuilt/toolchain/armv7a/bin/armv7a-cros-linux-gnueabi-g++
... -o obj/third_party/skia/src/ports/skia_library.SkFontHost_FreeType.o
../../third_party/skia/src/ports/SkFontHost_FreeType.cpp:37:31: fatal error:
freetype/ftmm.h: No such file or directory
 #include FT_MULTIPLE_MASTERS_H
                               ^
compilation terminated.

Original issue's description:
> Font variations.
>
> Multiple Master and TrueType fonts support variation axes.
> This implements back-end support for axes on platforms which
> support it.
>
> Committed: https://skia.googlesource.com/skia/+/05773ed30920c0214d1433c07cf6360a05476c97
>
> Committed: https://skia.googlesource.com/skia/+/3489ee0f4fa34f124f9de090d12bdc2107d52aa9

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

Review URL: https://codereview.chromium.org/1139123008
2015-05-15 11:30:41 -07:00
reed
daa57bfd42 Revert of antialias matrix-image-filter to get smooth diagonals (patchset #6 id:80002 of https://codereview.chromium.org/1134743003/)
Reason for revert:
likely affect layouttests, so need to add a guard

Original issue's description:
> antialias matrix-image-filter to get smooth diagonals
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/fa33f5a6b770130acdc55f2ffe19dd545665726a

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

Review URL: https://codereview.chromium.org/1128823010
2015-05-15 10:39:17 -07:00
reed
fa33f5a6b7 antialias matrix-image-filter to get smooth diagonals
BUG=skia:

Review URL: https://codereview.chromium.org/1134743003
2015-05-15 10:33:31 -07:00
bungeman
3489ee0f4f Font variations.
Multiple Master and TrueType fonts support variation axes.
This implements back-end support for axes on platforms which
support it.

Committed: https://skia.googlesource.com/skia/+/05773ed30920c0214d1433c07cf6360a05476c97

Review URL: https://codereview.chromium.org/1027373002
2015-05-14 14:18:03 -07:00
reed
86a17e7716 Revert of Implement support for non-scale/translate CTM in image filters. (patchset #4 id:60001 of https://codereview.chromium.org/1140943004/)
Reason for revert:
matriximagefilter needs to antialias its draw, so we get smooth diagonals...

Original issue's description:
> Implement support for non-scale/translate CTM in image filters.
>
> Clone with tweaks of https://codereview.chromium.org/986623003/
>
> pre-cl to guard chrome here: https://codereview.chromium.org/1133403003/
>
> BUG=skia:3288
>
> Committed: https://skia.googlesource.com/skia/+/35786b176c159d2e7a816e9da9b051ef3129d5cb

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

Review URL: https://codereview.chromium.org/1139173002
2015-05-14 12:25:22 -07:00
reed
35786b176c Implement support for non-scale/translate CTM in image filters.
Clone with tweaks of https://codereview.chromium.org/986623003/

pre-cl to guard chrome here: https://codereview.chromium.org/1133403003/

BUG=skia:3288

Review URL: https://codereview.chromium.org/1140943004
2015-05-14 06:36:53 -07:00
mtklein
c30806f9f1 Perform SkPicture analysis lazily.
I realized when writing the comment on https://crrev.com/1135363002/
that I'd really just sketched out the entire thing, so I couldn't help
but actually write up a working CL.  How does this do for your benchmark?

BUG=chromium:487075

Review URL: https://codereview.chromium.org/1130123006
2015-05-13 19:26:14 -07:00
reed
177cb84986 Revert of Implement support for non-scale/translate CTM in image filters. (patchset #4 id:60001 of https://codereview.chromium.org/1120043002/)
Reason for revert:
don't reference layer after its deleted

Original issue's description:
> Implement support for non-scale/translate CTM in image filters.
>
> Implemented by extracting out the non-scale/translate components
> and applying that post-filter as an SkMatrixImageFilter.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/4f12b8bd2cb43daeffa4d1c53120ae94c5ccf486

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

Review URL: https://codereview.chromium.org/1128133005
2015-05-13 14:00:00 -07:00
reed
4f12b8bd2c Implement support for non-scale/translate CTM in image filters.
Implemented by extracting out the non-scale/translate components
and applying that post-filter as an SkMatrixImageFilter.

BUG=skia:

Review URL: https://codereview.chromium.org/1120043002
2015-05-13 13:34:57 -07:00
bungeman
5ae1312c9f Revert of Font variations. (patchset #21 id:400001 of https://codereview.chromium.org/1027373002/)
Reason for revert:
Mac failing to build due to CFNumberType in Chromium Canary.

Original issue's description:
> Font variations.
>
> Multiple Master and TrueType fonts support variation axes.
> This implements back-end support for axes on platforms which
> support it.
>
> Committed: https://skia.googlesource.com/skia/+/05773ed30920c0214d1433c07cf6360a05476c97

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

Review URL: https://codereview.chromium.org/1128913008
2015-05-13 12:16:41 -07:00
bungeman
05773ed309 Font variations.
Multiple Master and TrueType fonts support variation axes.
This implements back-end support for axes on platforms which
support it.

Review URL: https://codereview.chromium.org/1027373002
2015-05-13 10:57:10 -07:00
reed
b56158118c simplify RawIter
BUG=skia:

Review URL: https://codereview.chromium.org/1137783006
2015-05-13 07:55:48 -07:00
kkinnunen
8f827fe44a Fix SkStrokeRec == to report true for all fills
Fix SkStrokeRec == to report true for all fills, regardless
of the stale stroking data the object might contain.

Review URL: https://codereview.chromium.org/1130153002
2015-05-13 00:02:26 -07:00
reed
80ea19ca4b Revert of Revert of stop calling SkScalarDiv (patchset #1 id:1 of https://codereview.chromium.org/1138263002/)
Reason for revert:
android patched, blink has rolled

Original issue's description:
> Revert of stop calling SkScalarDiv (patchset #4 id:60001 of https://codereview.chromium.org/1135053002/)
>
> Reason for revert:
> need to wait for Blink roll (and patch android)
>
> Original issue's description:
> > stop calling SkScalarDiv
> >
> > BUG=skia:
> > TBR=
> >
> > Committed: https://skia.googlesource.com/skia/+/67d71c898249a7af3523b16c6a69895a63bfae0a
>
> TBR=
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/2629697933b5cc975e45d2a45c48f803fc6cbcec

TBR=
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1135693003
2015-05-12 10:37:34 -07:00
reed
2629697933 Revert of stop calling SkScalarDiv (patchset #4 id:60001 of https://codereview.chromium.org/1135053002/)
Reason for revert:
need to wait for Blink roll (and patch android)

Original issue's description:
> stop calling SkScalarDiv
>
> BUG=skia:
> TBR=
>
> Committed: https://skia.googlesource.com/skia/+/67d71c898249a7af3523b16c6a69895a63bfae0a

TBR=
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1138263002
2015-05-12 10:28:06 -07:00
reed
39a9a5069b Make SkAdvancedTypefaceMetrics private.
Review URL: https://codereview.chromium.org/1129283003
2015-05-12 09:50:04 -07:00
reed
67d71c8982 stop calling SkScalarDiv
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1135053002
2015-05-12 09:47:22 -07:00
reed
b7ed856fad Revert of Sketch splitting SkPicture into an interface and SkBigPicture. (patchset #22 id:420001 of https://codereview.chromium.org/1112523006/)
Reason for revert:
speculative revert to fix failures in DEPS roll

Original issue's description:
> Sketch splitting SkPicture into an interface and SkBigPicture.
>
> Adds small pictures for drawRect(), drawTextBlob(), and drawPath().
> These cover about 89% of draw calls from Blink SKPs,
> and about 25% of draw calls from our GMs.
>
> SkPicture handles:
>   - serialization and deserialization
>   - unique IDs
>
> Everything else is left to the subclasses:
>   - playback(), cullRect()
>   - hasBitmap(), hasText(), suitableForGPU(), etc.
>   - LayerInfo / AccelData if applicable.
>
> The time to record a 1-op picture improves a good chunk
> (2 mallocs to 1), and the time to record a 0-op picture
> greatly improves (2 mallocs to none):
>
>     picture_overhead_draw:   450ns -> 350ns
>     picture_overhead_nodraw: 300ns -> 90ns
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/c92c129ff85b05a714bd1bf921c02d5e14651f8b

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

Review URL: https://codereview.chromium.org/1130333002
2015-05-07 17:30:13 -07:00
reed
8b26b99c97 new image from backend desc
BUG=485243

Review URL: https://codereview.chromium.org/1121813002
2015-05-07 15:36:18 -07:00
mtklein
c92c129ff8 Sketch splitting SkPicture into an interface and SkBigPicture.
Adds small pictures for drawRect(), drawTextBlob(), and drawPath().
These cover about 89% of draw calls from Blink SKPs,
and about 25% of draw calls from our GMs.

SkPicture handles:
  - serialization and deserialization
  - unique IDs

Everything else is left to the subclasses:
  - playback(), cullRect()
  - hasBitmap(), hasText(), suitableForGPU(), etc.
  - LayerInfo / AccelData if applicable.

The time to record a 1-op picture improves a good chunk
(2 mallocs to 1), and the time to record a 0-op picture
greatly improves (2 mallocs to none):

    picture_overhead_draw:   450ns -> 350ns
    picture_overhead_nodraw: 300ns -> 90ns

BUG=skia:

Review URL: https://codereview.chromium.org/1112523006
2015-05-07 13:41:07 -07:00
mtklein
fc00a7c501 SK_ARRAY_COUNT shouldn't work on pointers.
Simpler version of https://codereview.chromium.org/1123923002/

BUG=skia:3593
R=brucedawson@chromium.org,reed@google.com,tfarina@chromium.org

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

Review URL: https://codereview.chromium.org/1114283003
2015-05-07 10:58:44 -07:00
reed
a85d4d0814 Make drawImage a virtual on SkDevice
This reverts commit 06dad4b92f.

BUG=485243

Review URL: https://codereview.chromium.org/1129843003
2015-05-06 12:56:48 -07:00
reed
06dad4b92f Revert of Revert of Revert of Make drawImage a virtual on SkDevice (patchset #1 id:1 of https://codereview.chromium.org/1126273002/)
Reason for revert:
still breaking webglconformance

Original issue's description:
> Revert of Revert of Make drawImage a virtual on SkDevice (patchset #1 id:1 of https://codereview.chromium.org/1124003002/)
>
> Reason for revert:
> retry now that some fixes (onDrawImage overrides) have landed in chrome/blink
>
> Original issue's description:
> > Revert of Make drawImage a virtual on SkDevice (patchset #4 id:60001 of https://codereview.chromium.org/1122643005/)
> >
> > Reason for revert:
> > speculative to see if it unblocks DEPS roll
> >
> > Original issue's description:
> > > Make drawImage a virtual on SkDevice
> > >
> > > Now with patch for SkDeferredCanvas
> > >
> > > This reverts commit 119468b71f.
> > >
> > > BUG=skia:
> > >
> > > Committed: https://skia.googlesource.com/skia/+/14fe8fd3e53b5e988aac189a8bc3ed28904d85c8
> >
> > TBR=robertphillips@google.com,mtklein@google.com,reed@google.com
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > NOTRY=true
> > BUG=skia:
> >
> > Committed: https://skia.googlesource.com/skia/+/3538e3bfe2e00bc1b5b48d977fa7adff64d8c96b
>
> TBR=robertphillips@google.com,mtklein@google.com,reed@chromium.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/620ba3afe09d4173c87537040fe50c1c1895fb1a

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

Review URL: https://codereview.chromium.org/1127993004
2015-05-06 10:16:02 -07:00
reed
620ba3afe0 Revert of Revert of Make drawImage a virtual on SkDevice (patchset #1 id:1 of https://codereview.chromium.org/1124003002/)
Reason for revert:
retry now that some fixes (onDrawImage overrides) have landed in chrome/blink

Original issue's description:
> Revert of Make drawImage a virtual on SkDevice (patchset #4 id:60001 of https://codereview.chromium.org/1122643005/)
>
> Reason for revert:
> speculative to see if it unblocks DEPS roll
>
> Original issue's description:
> > Make drawImage a virtual on SkDevice
> >
> > Now with patch for SkDeferredCanvas
> >
> > This reverts commit 119468b71f.
> >
> > BUG=skia:
> >
> > Committed: https://skia.googlesource.com/skia/+/14fe8fd3e53b5e988aac189a8bc3ed28904d85c8
>
> TBR=robertphillips@google.com,mtklein@google.com,reed@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/3538e3bfe2e00bc1b5b48d977fa7adff64d8c96b

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

Review URL: https://codereview.chromium.org/1126273002
2015-05-06 07:54:38 -07:00
reed
3538e3bfe2 Revert of Make drawImage a virtual on SkDevice (patchset #4 id:60001 of https://codereview.chromium.org/1122643005/)
Reason for revert:
speculative to see if it unblocks DEPS roll

Original issue's description:
> Make drawImage a virtual on SkDevice
>
> Now with patch for SkDeferredCanvas
>
> This reverts commit 119468b71f.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/14fe8fd3e53b5e988aac189a8bc3ed28904d85c8

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

Review URL: https://codereview.chromium.org/1124003002
2015-05-05 17:30:45 -07:00
reed
14fe8fd3e5 Make drawImage a virtual on SkDevice
Now with patch for SkDeferredCanvas

This reverts commit 119468b71f.

BUG=skia:

Review URL: https://codereview.chromium.org/1122643005
2015-05-05 12:54:33 -07:00
reed
d1290843c3 remove dead code behind BOOL_ONGETINFO
need this to land in chrome first https://codereview.chromium.org/1125573002

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1123473004
2015-05-05 11:36:02 -07:00
reed
119468b71f Revert of Make drawImage a virtual on SkDevice (patchset #3 id:40001 of https://codereview.chromium.org/11188… (patchset #2 id:20001 of https://codereview.chromium.org/1122813002/)
Reason for revert:
did not update DeferredCanvas

Original issue's description:
> Make drawImage a virtual on SkDevice (patchset #3 id:40001 of https://codereview.chromium.org/1118823004/)"
>
> Fixed serialization from prev CL
>
> This reverts commit 973d1f1f60.
>
> BUG=skia:3803
> TBR=
>
> Committed: https://skia.googlesource.com/skia/+/5392785080001fe737fac9e5801fc2127a78d4fb

TBR=
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:3803

Review URL: https://codereview.chromium.org/1123743006
2015-05-05 05:42:02 -07:00
reed
5392785080 Make drawImage a virtual on SkDevice (patchset #3 id:40001 of https://codereview.chromium.org/1118823004/)"
Fixed serialization from prev CL

This reverts commit 973d1f1f60.

BUG=skia:3803
TBR=

Review URL: https://codereview.chromium.org/1122813002
2015-05-04 10:49:41 -07:00
bsalomon
ed0bcad9c8 Move instanced index buffer creation to flush time
Committed: https://skia.googlesource.com/skia/+/ab622c7b8cc8c39f0a594e4392b9e31b7e1ddb26

Review URL: https://codereview.chromium.org/1116943004
2015-05-04 10:36:43 -07:00
bsalomon
d8ed1b64a6 Revert of Move instanced index buffer creation to flush time (patchset #6 id:100001 of https://codereview.chromium.org/1116943004/)
Reason for revert:
messed up caching, recreating index buffers all the time.

Original issue's description:
> Move instanced index buffer creation to flush time
>
> Committed: https://skia.googlesource.com/skia/+/ab622c7b8cc8c39f0a594e4392b9e31b7e1ddb26

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

Review URL: https://codereview.chromium.org/1126613003
2015-05-04 10:09:24 -07:00
reed
973d1f1f60 Revert of make drawImage a virtual on SkDevice (patchset #3 id:40001 of https://codereview.chromium.org/1118823004/)
Reason for revert:
need to make serialization work for pictures, now that images are "real"

Original issue's description:
> make drawImage a virtual on SkDevice
>
> default impl will turn the Image into a (raster) bitmap and call drawBitmap.
>
> BUG=skia:3803
>
> Committed: https://skia.googlesource.com/skia/+/f603fb3d0e5fa57c3f228d66945bef198b001135

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

Review URL: https://codereview.chromium.org/1122803002
2015-05-04 09:00:46 -07:00
reed
71a6cbfc58 remove redundant/deprecated TwoPointRadial gradiet -- use TwoPointConical
This CL derived from https://codereview.chromium.org/1114243005/

BUG=skia:

Review URL: https://codereview.chromium.org/1117423003
2015-05-04 08:32:51 -07:00
reed
f603fb3d0e make drawImage a virtual on SkDevice
default impl will turn the Image into a (raster) bitmap and call drawBitmap.

BUG=skia:3803

Review URL: https://codereview.chromium.org/1118823004
2015-05-04 08:32:02 -07:00
bsalomon
ab622c7b8c Move instanced index buffer creation to flush time
Review URL: https://codereview.chromium.org/1116943004
2015-05-04 08:09:30 -07:00
reed
a499f905e9 clean up pre-storage in canvas
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1117213003
2015-05-01 09:34:31 -07:00
joshualitt
3dc2ccae6c Simple CL to add a joinWithPossiblyEmptyArg to SkRect
BUG=skia:

Review URL: https://codereview.chromium.org/1118293002
2015-05-01 08:51:48 -07:00
halcanary
0b9d4118ba SkTime: return timezone information; format in ISO-8601
Motivation: PDF/A metadata will need the creation date embedded in it.

Also, GetDateTime returns local time in Win32.  This now behaves the
same as on Unix systems.

BUG=skia:3110

Review URL: https://codereview.chromium.org/1109593002
2015-05-01 07:06:23 -07:00
reed
1c2c441fed add heuristic to pour small pictures into recordings, rather than ref'ing
BUG=skia:

Review URL: https://codereview.chromium.org/1118693003
2015-04-30 13:09:25 -07:00
mtklein
4f7ec55f71 Make SkAutoTDelete's operator T*() const, like all the others.
BUG=skia:

Review URL: https://codereview.chromium.org/1114043005
2015-04-30 12:06:19 -07:00
joshualitt
3f655f34a2 Initial CL to create GrBatchTest infrastructure
BUG=skia:

Review URL: https://codereview.chromium.org/1109153004
2015-04-29 10:01:22 -07:00
reed
61f501f8c6 onCreateDevice -> NULL now means the caller should create its own (bitmap) device
BUG=skia:

Review URL: https://codereview.chromium.org/1116453002
2015-04-29 08:34:00 -07:00
caryclark
aec2510125 minor fixes to cubics code and overall alignment of how bounds and tops are computed for all curve types
All but 17 extended tests work.

A helper function is privately added to SkPath.h to permit a test to modify a given point in a path.

BUG=skia:3588

Review URL: https://codereview.chromium.org/1107353004
2015-04-29 08:28:30 -07:00
mtklein
2420e10d5a Straighten out SkPicture::AccelData APIs.
Must have been we needed them to be weird (mutable, const setter) before.
It doesn't look like that's necessary now... we can just pass it to the
constructor.

BUG=skia:

Review URL: https://codereview.chromium.org/1112833003
2015-04-29 08:16:50 -07:00
dongseong.hwang
79612de00f Remove useless SkASSERT in SkRect.h and SkRegion.h
The pointer of reference is always not-null. It causes >50k lines of warnning when chromium is compiled by clang.
Warning looks like
../../third_party/skia/include/core/SkRect.h:284:19: warning: reference cannot be bound to dereferenced null pointer in well-defined C++ code; pointer may be assumed to always convert to true [-Wundefined-bool-conversion]
    do { if (&r) break; SkNO_RETURN_HINT(); SkDebugf_FileLine("../../third_party/skia/include/core/SkRect.h", 284, false, "%s:%d: failed assertion \"%s\"\n", "../../third_party/skia/include/core/SkRect.h", 284, "&r"); SkDebugf_FileLine("../../third_party/skia/include/core/SkRect.h", 284, true, "SK_CRASH"); } while (false);

Review URL: https://codereview.chromium.org/1111013002
2015-04-28 12:47:48 -07:00
mtklein
95cc012cca De-proc Color32
Also strips SK_SUPPORT_LEGACY_COLOR32_MATH,
which is no longer needed.

Seems handy to have SkTypes include the relevant intrinsics when
we know we've got them, but I'm not married to it.

Locally this looks like a pointlessly small perf win, but I'm mostly
keen to get all the code together.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/376e9bc206b69d9190f38dfebb132a8769bbd72b

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

CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-Mips-Debug-Android-Trybot

Review URL: https://codereview.chromium.org/1104183004
2015-04-27 15:11:01 -07:00
mtklein
641c3ff7c6 Revert of De-proc Color32 (patchset #5 id:80001 of https://codereview.chromium.org/1104183004/)
Reason for revert:
duh

Original issue's description:
> De-proc Color32
>
> Also strips SK_SUPPORT_LEGACY_COLOR32_MATH,
> which is no longer needed.
>
> Seems handy to have SkTypes include the relevant intrinsics when
> we know we've got them, but I'm not married to it.
>
> Locally this looks like a pointlessly small perf win, but I'm mostly
> keen to get all the code together.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/376e9bc206b69d9190f38dfebb132a8769bbd72b
>
> Committed: https://skia.googlesource.com/skia/+/d65dc0cedd5b50dd407b6ff8fdc39123f11511cc

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

Review URL: https://codereview.chromium.org/1102363006
2015-04-27 14:51:16 -07:00
mtklein
d65dc0cedd De-proc Color32
Also strips SK_SUPPORT_LEGACY_COLOR32_MATH,
which is no longer needed.

Seems handy to have SkTypes include the relevant intrinsics when
we know we've got them, but I'm not married to it.

Locally this looks like a pointlessly small perf win, but I'm mostly
keen to get all the code together.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/376e9bc206b69d9190f38dfebb132a8769bbd72b

Review URL: https://codereview.chromium.org/1104183004
2015-04-27 14:47:23 -07:00
mtklein
498856ebc6 Revert of De-proc Color32 (patchset #4 id:60001 of https://codereview.chromium.org/1104183004/)
Reason for revert:
MIPS

Original issue's description:
> De-proc Color32
>
> Also strips SK_SUPPORT_LEGACY_COLOR32_MATH,
> which is no longer needed.
>
> Seems handy to have SkTypes include the relevant intrinsics when
> we know we've got them, but I'm not married to it.
>
> Locally this looks like a pointlessly small perf win, but I'm mostly
> keen to get all the code together.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/376e9bc206b69d9190f38dfebb132a8769bbd72b

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

Review URL: https://codereview.chromium.org/1108163002
2015-04-27 14:17:37 -07:00
mtklein
376e9bc206 De-proc Color32
Also strips SK_SUPPORT_LEGACY_COLOR32_MATH,
which is no longer needed.

Seems handy to have SkTypes include the relevant intrinsics when
we know we've got them, but I'm not married to it.

Locally this looks like a pointlessly small perf win, but I'm mostly
keen to get all the code together.

BUG=skia:

Review URL: https://codereview.chromium.org/1104183004
2015-04-27 14:14:17 -07:00
mtklein
00c2af8b73 Reduce ref counting in SkPictureRecorder.
This may be a small help to slimming paint:

  picture_overhead_draw 1.25us -> 1.22us    0.98x
  picture_overhead_nodraw    318ns ->  276ns    0.87x

It certainly cannot hurt performance.

BUG=chromium:470553

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

Review URL: https://codereview.chromium.org/1098183003
2015-04-27 08:54:23 -07:00
jbroman
de8667b81f Reduce sizeof(SkPicture::Analysis) from 24 bytes to 2 bytes.
This saves "up to" 22 bytes per SkPicture.

Due to alignment, this reduces sizeof(SkPicture):
- from 88 to 72 bytes on Linux x64
- from 68 to 48 bytes on Android
(with Chrome's build settings)

It also somewhat simplifies the GPU veto logic.

BUG=skia:

[mtklein] No public API changes.
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1060863004
2015-04-27 07:55:34 -07:00
tfarina
567ff2f614 Cleanup: Remove unnecessary double-semicolons.
The entries were found by the following command line:

$ find . -regex ".*\.[cChH]\(pp\)?" | xargs git grep -e ';;' --and --not
-e 'for *(.*;;'

Which is a combination of http://stackoverflow.com/a/3858879 and
http://gitster.livejournal.com/27674.html

BUG=None
R=mtklein@google.com

Review URL: https://codereview.chromium.org/1088763005
2015-04-27 07:01:45 -07:00
robertphillips
91df6c273a Fix some lingering typos
Review URL: https://codereview.chromium.org/1101293003
2015-04-24 11:10:51 -07:00
mtklein
98b8485a4c O(1) SkPictureUtils::ApproxBytesUsed()
Chrome wants to call this more often, and it's quite slow today.

Seems like this could be clearer if SkPictureUtils::ApproxBytesUsed() were SkPicture::approxBytesUsed().

BUG=chromium:471873

Review URL: https://codereview.chromium.org/1090943004
2015-04-21 15:24:00 -07:00
mtklein
f3f9440372 Revert of Allow NEON on iOS. (patchset #3 id:40001 of https://codereview.chromium.org/1091823002/)
Reason for revert:
need to coordinate this with chrome gyps/gn

Original issue's description:
> Allow NEON on iOS.
>
> I have nanobench building and running (Color32_arm_neon) on my iPad.
>
> No public API changes.
> TBR=reed@google.com
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/e5043b7ea5170a639367b67c986568907576be4b

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

Review URL: https://codereview.chromium.org/1094843005
2015-04-17 14:02:40 -07:00
bungeman
9d911d5a93 Remove filename from SkFontDescriptor.
No one actually uses it, so remove it. Keep the string id for backward
compatibility.

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

Review URL: https://codereview.chromium.org/1057413005
2015-04-17 11:00:06 -07:00
bungeman
f4fddfc300 Correct SkFixedToDouble.
SkFixedToDouble uses the decimal floating point string representation
of 1/(2^16) to provide a constant value. This value is exactly
representable by a double but the decimal constant currently used
does not map to this value.

This change modifies this constant to more decimal digits so that
the actual double value desired is created.

Review URL: https://codereview.chromium.org/1097473002
2015-04-17 10:05:43 -07:00
mtklein
e5043b7ea5 Allow NEON on iOS.
I have nanobench building and running (Color32_arm_neon) on my iPad.

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

BUG=skia:

Review URL: https://codereview.chromium.org/1091823002
2015-04-17 06:36:53 -07:00
bungeman
fd0ecf46ce Add SkTPin.
Currently there exist SkScalarPin and SkPin32, and in a future change
another version is desired. This change introduces SkTPin and changes
SkScalarPin and SkPin32 to use it.

Review URL: https://codereview.chromium.org/1090003002
2015-04-16 12:18:28 -07:00
halcanary
00b7e5eb97 SkPDF/Device/ImageFilter: Fix ImageFilter fallback code
Broken in https://chromium.googlesource.com/skia/+/76033be

I have confirmed that this fixes 470083.

BUG=470083

Review URL: https://codereview.chromium.org/1080923004
2015-04-15 13:05:18 -07:00
joshualitt
9e36c1a930 Start canonicalizing color for all A8 textblobs
BUG=skia:

Review URL: https://codereview.chromium.org/1076593002
2015-04-14 12:17:27 -07:00
egdaniel
f103cd8539 Set resScale on stroker when stroking path on gpu.
BUG=skia:3686

Review URL: https://codereview.chromium.org/1048333003
2015-04-13 13:06:46 -07:00
robertphillips
25c40d25d7 Add serialization of SkBitmapSource's new filterQuality member variable
Missed this in https://codereview.chromium.org/1072603002/ (Add GM to repro crbug.com/472795)

Review URL: https://codereview.chromium.org/1078113002
2015-04-10 08:39:58 -07:00
mtklein
9ff378b01b Rewrite memset benches, then use results to add a small-N optimization.
The benches for N <= 10 get around 2x faster on my N7 and N9.  I believe this
is because of the reduced function-call-then-function-pointer-call overhead on
the N7, and additionally because it seems autovectorization beats our NEON code
for small N on the N9.

My desktop is unchanged, though that's probably because N=10 lies well within a
region where memset's performance is essentially constant: N=100 takes only
about 2x as long as N=1 and N=10, which perform nearly identically.

BUG=skia:

Review URL: https://codereview.chromium.org/1073863002
2015-04-09 14:05:17 -07:00
fmalita
055f6b59d8 [SkTextBlob] Custom run font record
Instead of using a full-blown SkPaint to store run font info, use a
custom structure.

This saves 96 bytes / run on 64bit platforms.

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

Review URL: https://codereview.chromium.org/1070943002
2015-04-09 08:49:32 -07:00
fmalita
f57546ec7f Remove SK_SUPPORT_LEGACY_SCALAR_MAPPOINTS
No longer used in Chromium.

Also drop now-unused SkMatrix::Rot_pts() & SkMatrix::RotTrans_pts().

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

Review URL: https://codereview.chromium.org/1071833002
2015-04-09 06:13:15 -07:00
jbroman
7d1b945da6 Mark SkPictureRecorder::endRecording as SK_WARN_UNUSED_RESULT.
Ignoring the result is a memory leak.
Callers should always at least unref the result.

This bug has occurred in Blink:
  https://codereview.chromium.org/1068413002/

BUG=skia:3680

Review URL: https://codereview.chromium.org/1072633002
2015-04-09 06:12:17 -07:00
halcanary
16e833d5aa SkString: remove fStr member
Motivation:  I'd like sizeof(SkString) to be the same in Debug and Release.

Review URL: https://codereview.chromium.org/1073473003
2015-04-08 13:01:22 -07:00
mtklein
feaadee1c3 SkCanvas::resetForNextPicture()
No diffs against head for DM --config 8888 gpu 2ndpic-8888 2ndpic-gpu.

  picture_overhead_draw	1.62us ->  1.6us	0.99x
picture_overhead_nodraw	 792ns ->  342ns	0.43x

tiles and serialization modes will also test this a bit.

BUG=chromium:470553

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

Review URL: https://codereview.chromium.org/1067893002
2015-04-08 11:25:48 -07:00
joshualitt
b7133bed55 Adding a cache + memory pool for GPU TextBlobs
BUG=skia:

Review URL: https://codereview.chromium.org/1055843002
2015-04-08 09:08:31 -07:00
bsalomon
e4579adfdf Add helper for creating a SkSurface from a client created texture.
Review URL: https://codereview.chromium.org/1071603002
2015-04-08 08:38:40 -07:00
caryclark
95bc5f3495 change isNestedRect to isNestedFillRect
R=reed@google.com, bsalomon@google.com

Let isNested(Fill)Rect return true if drawn path describes filled
rectangles.

Review URL: https://codereview.chromium.org/1073473002
2015-04-08 08:34:15 -07:00
joshualitt
f1f8895cbe add realloc method to SkAutoSTMalloc
BUG=skia:

Review URL: https://codereview.chromium.org/1069013002
2015-04-08 07:33:33 -07:00
mtklein
c654e9016a Revert of SkCanvas::resetForNextPicture() (patchset #4 id:60001 of https://codereview.chromium.org/1067893002/)
Reason for revert:
https://uberchromegw.corp.google.com/i/client.skia/builders/Linux%20Tests/builds/1816

Original issue's description:
> SkCanvas::resetForNextPicture()
>
> No diffs against head for DM --config 8888 gpu 2ndpic-8888 2ndpic-gpu.
>
>   picture_overhead_draw	1.62us ->  1.6us	0.99x
> picture_overhead_nodraw	 792ns ->  342ns	0.43x
>
> tiles and serialization modes will also test this a bit.
>
> BUG=chromium:470553
>
> Committed: https://skia.googlesource.com/skia/+/f920e468ac66a36c9653d1b11181480295044c7d

TBR=mtklein@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:470553

Review URL: https://codereview.chromium.org/1062353002
2015-04-07 15:27:14 -07:00
mtklein
f920e468ac SkCanvas::resetForNextPicture()
No diffs against head for DM --config 8888 gpu 2ndpic-8888 2ndpic-gpu.

  picture_overhead_draw	1.62us ->  1.6us	0.99x
picture_overhead_nodraw	 792ns ->  342ns	0.43x

tiles and serialization modes will also test this a bit.

BUG=chromium:470553

Review URL: https://codereview.chromium.org/1067893002
2015-04-07 14:11:22 -07:00
reed
687fa1c745 restore clipstack to heap-ptr, so clients can ref it
BUG=skia:

Review URL: https://codereview.chromium.org/1068883004
2015-04-07 08:00:56 -07:00
mtklein
e35268ef4c Send SkPicture deletion message lazily.
If no one has read the picture's unique ID, there's no point invalidating it.

This is the same trick we pull with SkPixelRefs.

Before:
  26M	1	1.49µs	1.6µs	1.77µs	6.25µs	42%	picture_overhead_draw
  13M	32	742ns	749ns	756ns	823ns	2%	picture_overhead_nodraw

After:
  26M	1	1.27µs	1.33µs	1.49µs	5.51µs	45%	picture_overhead_draw
  14M	43	677ns	680ns	681ns	701ns	1%	picture_overhead_nodraw

BUG=skia:

Review URL: https://codereview.chromium.org/1061283002
2015-04-07 06:34:05 -07:00
reed
b679ca8926 reduce alloc overhead for SkCanvas
use pre-allocated space in the canvas to avoid initial calls to malloc

BUG=skia:

Review URL: https://codereview.chromium.org/1060583007
2015-04-07 04:40:48 -07:00
mtklein
76f5cc6e9e Clean up BlockRef
- It's no longer needed to help the (2011?) transition to SkAutoTUnref.
  - It prevents us from making classes that go in SkAutoTUnrefs final,
    i.e. all ref-counted classes.

This had better not have been public API...
TBR=reed@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/1068443002
2015-04-06 08:57:32 -07:00
scroggo
028a4135aa Add a method to read a stream without advancing it.
Add a virtual method on SkStream which will do a "peek" some bytes, so
that those bytes are read, but the next call to read will be
unaffected.

Implement peek for SkMemoryStream, where the implementation is simple
and obvious.

Implement peek on SkFrontBufferedStream.

Add tests.

Motivated by decoding streams which cannot be rewound.

TBR=reed@google.com

BUG=skia:3257

Review URL: https://codereview.chromium.org/1044953002
2015-04-02 13:19:51 -07:00
borenet
4808757d7a Remove all code related to NaCl
BUG=skia:3600
DOCS_PREVIEW= https://skia.org/?cl=1036283002

Review URL: https://codereview.chromium.org/1036283002
2015-04-02 12:16:36 -07:00
joshualitt
dbd3593e0b Rename GrBitmapTextContextB to GrAtlasTextContext
BUG=skia:

Review URL: https://codereview.chromium.org/1050173002
2015-04-02 09:19:04 -07:00
joshualitt
2b6acb4ed5 Switch to one single bitmap text blob cache allocation
BUG=skia:

Review URL: https://codereview.chromium.org/1041953002
2015-04-01 11:30:28 -07:00
joshualitt
7c3a2f834e BitmapTextBatch and BitmapTextBlob
BUG=skia:

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

Review URL: https://codereview.chromium.org/1011403004
2015-03-31 13:32:05 -07:00
joshualitt
c03391e792 Revert of BitmapTextBatch and BitmapTextBlob (patchset #18 id:360001 of https://codereview.chromium.org/1011403004/)
Reason for revert:
Breaks a unit test on mac

Original issue's description:
> BitmapTextBatch and BitmapTextBlob
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/eed1dae04932483579b02c10f0706127d3f5d984

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

Review URL: https://codereview.chromium.org/1050633002
2015-03-31 11:33:08 -07:00
joshualitt
eed1dae049 BitmapTextBatch and BitmapTextBlob
BUG=skia:

Review URL: https://codereview.chromium.org/1011403004
2015-03-31 11:04:53 -07:00
mtklein
50ffd9921e Extract the spinlock from SkOnce as SkSpinlock.
This uses slightly newer APIs from SkAtomics.h to make it a bit more efficient.

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

BUG=skia:

Review URL: https://codereview.chromium.org/1039323002
2015-03-30 08:13:34 -07:00
reed
7da19014fd use Sk4f for matrix math
Need to land SK_SUPPORT_LEGACY_SCALAR_MAPPOINTS in chrome to suppress Affine
version which causes slight differences (which will need to be rebaselined)

BUG=skia:

Review URL: https://codereview.chromium.org/1045493002
2015-03-29 11:58:48 -07:00
reed
d8b34c26c2 use table of procs (and unrolling) to speed up mapPts
BUG=skia:

Review URL: https://codereview.chromium.org/1040783002
2015-03-27 14:00:41 -07:00
scroggo
5cffba8d8e Remove SkMemoryStream::peek()
I'd like to add a new API to SkStream for peeking - i.e. reading some
bytes without advancing the stream. This will be implemented for the
streams where it makes sense. I think the function should look
something like the following:

size_t peek(void* buffer, size_t bytesToRead) {
     return this->onPeek(buffer, bytesToRead);
}

virtual size_t onPeek(void* buffer, size_t bytesToRead) {
    return 0;   // unimplemented base class.
}

In order to avoid confusion, I'd like to remove SkMemoryStream::peek(),
which is not currently used internally, by Chrome, or by Android as far
as I can tell. There is also another function does the same thing:
getPosition().

BUG=skia:3257

Review URL: https://codereview.chromium.org/1039373002
2015-03-27 13:27:51 -07:00
robertphillips
1d24b8dfe9 Add matrix constructing helpers to SkMatrix
Review URL: https://codereview.chromium.org/1034273002
2015-03-26 19:57:08 -07:00
mtklein
36352bf5e3 C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla}
NOPRESUBMIT=true

BUG=skia:
DOCS_PREVIEW= https://skia.org/?cl=1037793002

Review URL: https://codereview.chromium.org/1037793002
2015-03-25 18:17:32 -07:00
joshualitt
2af858354d simple patch to always init SkTextBlob uniqueID
BUG=skia:

Review URL: https://codereview.chromium.org/1036613002
2015-03-25 13:40:13 -07:00
senorblanco
8c24d453a2 Move SkMatrixImageFilter.h into src/core.
Callers in Blink have been updated to call
SkImageFilter::CreateMatrixFilter() instead.

BUG=skia:3568

Review URL: https://codereview.chromium.org/1013753013
2015-03-24 07:51:30 -07:00
reed
62a320c8d4 Revert of Revert of remove colorfilter native-565 support. complicating w/ no real value. (patchset #1 id:1 of https://codereview.chromium.org/1022673007/)
Reason for revert:
fix for chrome has landed...

Original issue's description:
> Revert of remove colorfilter native-565 support. complicating w/ no real value. (patchset #2 id:20001 of https://codereview.chromium.org/1015533011/)
>
> Reason for revert:
> skia/ext/benchmarking_canvas.cc references HasFilter16 :(
>
> Original issue's description:
> > remove colorfilter native-565 support. complicating w/ no real value.
> >
> > BUG=skia:
> > TBR=
> >
> > Committed: https://skia.googlesource.com/skia/+/2151353d161fe389cdc0db62cfe1932c7680f710
>
> TBR=reed@chromium.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/92b47c49016749249ff8521e424c4373b4a74241

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

Review URL: https://codereview.chromium.org/1016103004
2015-03-24 06:35:23 -07:00
reed
92b47c4901 Revert of remove colorfilter native-565 support. complicating w/ no real value. (patchset #2 id:20001 of https://codereview.chromium.org/1015533011/)
Reason for revert:
skia/ext/benchmarking_canvas.cc references HasFilter16 :(

Original issue's description:
> remove colorfilter native-565 support. complicating w/ no real value.
>
> BUG=skia:
> TBR=
>
> Committed: https://skia.googlesource.com/skia/+/2151353d161fe389cdc0db62cfe1932c7680f710

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

Review URL: https://codereview.chromium.org/1022673007
2015-03-24 05:18:09 -07:00
reed
2151353d16 remove colorfilter native-565 support. complicating w/ no real value.
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1015533011
2015-03-24 03:50:22 -07:00
reed
8010632f24 remove meaningless matrix benches, add mapPts() and add new benches
mapPts definitely faster than mapPoints (identity and perspective same speed). Up to 3x for large values of N.

cloned from https://codereview.chromium.org/1031443002/

BUG=skia:

Review URL: https://codereview.chromium.org/1030653002
2015-03-23 08:15:14 -07:00
joshualitt
9c328187d9 Initial change to move text blob to GrTextContext
BUG=skia:

Review URL: https://codereview.chromium.org/1019633002
2015-03-23 08:13:04 -07:00
tomhudson
68260fa1e9 Make SkCanvas::getBaseLayerSize() virtual
Subclasses of SkCanvas may need to override the behavior here - for
example, any proxy or deferred canvas may not know its own size and
need to delegate to another object.

We'll also work on reducing use of this function
(https://skbug.com/3569), but some of the current uses seem to be
semantically necessary.

R=reed@google.com
BUG=skia:3566

Review URL: https://codereview.chromium.org/1022423002
2015-03-23 07:22:40 -07:00
reed
5fedef1c31 remove SK_SUPPORT_LEGACY_PIXELREF_UNFLATTENABLE code
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1020403002
2015-03-20 14:20:09 -07:00
scroggo
1dd3ea9d45 Add SkEncodedFormat, used by SkCodec.
Needed by Android to determine the format.

Review URL: https://codereview.chromium.org/1018953003
2015-03-20 11:55:55 -07:00
joshualitt
6e8cd96719 Let text contexts fall back directly to paths
BUG=skia:

Review URL: https://codereview.chromium.org/1015173002
2015-03-20 10:30:14 -07:00
mtklein
b79ff56de2 Specialize Sk2d for ARM64
The implementation is nearly identical to Sk2f, with these changes:
  - float32x2_t -> float64x2_t
  - vfoo -> vfooq
  - one extra Newton's method step in sqrt().

Also, generally fix NEON detection to be defined(SK_ARM_HAS_NEON).
SK_ARM_HAS_NEON is not being set on ARM64 bots right now (nor does the compiler
seem to set __ARM_NEON__), so this CL fixes everything up.

BUG=skia:

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

CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.7-Clang-Arm7-Debug-iOS-Trybot,Build-Ubuntu-GCC-Arm64-Release-Android-Trybot

Review URL: https://codereview.chromium.org/1020963002
2015-03-20 09:25:26 -07:00
henrik.smiding
70840cbd89 Replace SSE optimization of Color32A_D565
Adds an SSE2 version of the Color32A_D565 function, to replace
the existing SSE4 version. Also does some minor cleanup.

Performance improvement in the following Skia benchmarks.
Measured on Atom Silvermont:
  Xfermode_SrcOver       - x3
  luma_colorfilter_large - x4.6
  luma_colorfilter_small - x2
  tablebench             - ~15%
  chart_bw               - ~10%

Measured on Corei7 Haswell:
luma_colorfilter_large running SSE2 - x2
luma_colorfilter_large running SSE4 - x2.3

Also improves performance in WPS Office application and 2D subtest of 0xbenchmark on Android.

Signed-off-by: Henrik Smiding <henrik.smiding@intel.com>

Review URL: https://codereview.chromium.org/923523002
2015-03-20 09:20:46 -07:00
mtklein
c3ce1d28a5 Revert of Specialize Sk2d for ARM64 (patchset #3 id:40001 of https://codereview.chromium.org/1020963002/)
Reason for revert:
https://uberchromegw.corp.google.com/i/client.skia.compile/builders/Build-Mac10.7-Clang-Arm7-Debug-iOS/builds/2441/steps/build%20most/logs/stdio

https://uberchromegw.corp.google.com/i/client.skia.compile/builders/Build-Mac10.7-Clang-Arm7-Release-iOS/builds/2424/steps/build%20most/logs/stdio

https://uberchromegw.corp.google.com/i/client.skia.compile/builders/Build-Ubuntu-GCC-Arm64-Release-Android/builds/8/steps/build%20most/logs/stdio

Original issue's description:
> Specialize Sk2d for ARM64
>
> The implementation is nearly identical to Sk2f, with these changes:
>   - float32x2_t -> float64x2_t
>   - vfoo -> vfooq
>   - one extra Newton's method step in sqrt().
>
> Also, generally fix NEON detection to be defined(SK_ARM_HAS_NEON).
> SK_ARM_HAS_NEON is not being set on ARM64 bots right now (nor does the compiler
> seem to set __ARM_NEON__), so this CL fixes everything up.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/e57b5cab261a243dcbefa74c91c896c28959bf09

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

Review URL: https://codereview.chromium.org/1028523003
2015-03-20 08:46:34 -07:00
mtklein
e57b5cab26 Specialize Sk2d for ARM64
The implementation is nearly identical to Sk2f, with these changes:
  - float32x2_t -> float64x2_t
  - vfoo -> vfooq
  - one extra Newton's method step in sqrt().

Also, generally fix NEON detection to be defined(SK_ARM_HAS_NEON).
SK_ARM_HAS_NEON is not being set on ARM64 bots right now (nor does the compiler
seem to set __ARM_NEON__), so this CL fixes everything up.

BUG=skia:

Review URL: https://codereview.chromium.org/1020963002
2015-03-20 08:32:35 -07:00
senorblanco
8c874eee94 Move SkMatrixImageFilter into core, and add a factory fn for it.
BUG=skia:

Review URL: https://codereview.chromium.org/1011273003
2015-03-20 06:38:17 -07:00
reed
adf9990cb5 add SkMatrix::decomposeScale
BUG=skia:

Review URL: https://codereview.chromium.org/1006173005
2015-03-19 16:10:54 -07:00
reed
3ef71e343b guarded change to SkImageGenerator to make getInfo() const
BUG=skia:

Review URL: https://codereview.chromium.org/1017293002
2015-03-19 08:31:14 -07:00
reed
effcba4a4d Revert of replace SkFixedDiv impl with native 64bit math (patchset #2 id:20001 of https://codereview.chromium.org/1022543003/)
Reason for revert:
http://build.chromium.org/p/tryserver.blink/builders/linux_blink_rel/builds/53096

layouttests failures

Original issue's description:
> replace SkFixedDiv impl with native 64bit math
>
> BUG=skia:
> TBR=
>
> Committed: https://skia.googlesource.com/skia/+/7c44ca926bf42b3b2e56131f250c0fd58f87ac71

TBR=
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1018523008
2015-03-19 04:10:42 -07:00
reed
7c44ca926b replace SkFixedDiv impl with native 64bit math
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1022543003
2015-03-18 19:04:43 -07:00
senorblanco
4a22a433bf Bump picture version for uniqueID-less SkImageFilter.
Remove writing of the uniqueID, and put reading behind a version check.

BUG=skia:3559

Review URL: https://codereview.chromium.org/1010433003
2015-03-18 13:14:54 -07:00
senorblanco
24e06d5244 Remove uniqueID from all filter serialization.
(This is essentially a revert of https://codereview.chromium.org/503833002/.)

This was necessary back when SkPaint was flattened even for in-process use. Now that we only flatten SkPaint for cross-process use, there's no need to serialize UniqueIDs.

Note: SkDropShadowImageFilter is being constructed with a croprect and UniqueID (of 0) in Blink. I've made the uniqueID param default to 0 temporarily, until this rolls in and Blink can be changed. (Blink can't be changed first, since unlike the other filters, there's no constructor that takes a cropRect but not a uniqueID.)

BUG=skia:

Review URL: https://codereview.chromium.org/1019493002
2015-03-18 12:11:33 -07:00
scroggo
b267fd629b Add comment describing SkColorTable constructor.
Review URL: https://codereview.chromium.org/1011263002
2015-03-18 08:00:27 -07:00
reed
0c9b1a8d05 add kGray_8_SkColorType
patch from issue 1014783003 at patchset 60001 (http://crrev.com/1014783003#ps60001)

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1010343002
2015-03-17 17:44:07 -07:00
bungeman
d709ea8d14 Remove SkLONGLONG.
All users now define SkLONGLONG.
This fixes a long outstanding TODO now that int64_t is required.

BUG=skia:179

Review URL: https://codereview.chromium.org/1000933003
2015-03-17 07:23:39 -07:00
scroggo
9552662e9f Option for SkCodec to treat dst as all zeroes.
This recreates SkImageDecoder's feature to skip writing zeroes for
SkCodec.

Review URL: https://codereview.chromium.org/980903002
2015-03-17 05:02:17 -07:00
reed
e7903c7397 FilterLevel -> SkFilterQuality
BUG=skia:
TBR=
NOTREECHECKS=True
NOTRY=True

Review URL: https://codereview.chromium.org/1010023002
2015-03-16 10:26:13 -07:00
reed
93a1215fe0 SkPaint::FilterLevel -> SkFilterQuality
clone (+rebase) of https://codereview.chromium.org/1009183002/

BUG=skia:
TBR=scroggo@google.com

Review URL: https://codereview.chromium.org/1014533004
2015-03-16 10:08:34 -07:00
reed
3a224666df remove deprecated setFilterBitmap/isFilterBitmap
BUG=skia:

Review URL: https://codereview.chromium.org/1006213002
2015-03-16 07:24:05 -07:00
reed
19c25f18a3 move kTileModeCount out of TileMode enum
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1009193002
2015-03-15 14:01:21 -07:00
reed
6af1b05b24 remove legacy onCreateCompatibleDevice
needs this to land in chrome first : https://codereview.chromium.org/1013453002/

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1006183002
2015-03-14 17:51:34 -07:00
reed
76033be81b Revert[6] of Change device creation to see the (optional) layer-paint
This reverts commit 173e5fe5f4.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1010503002
2015-03-14 10:54:31 -07:00
reed
57a48a73a4 add onCreateDevice to eventually replace onCreateCompatibleDevice
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1006923004
2015-03-14 04:30:21 -07:00
reed
173e5fe5f4 Revert of Revert of Revert of Revert of Revert of Change device creation to see the (optional) layer-paint (patchset #1 id:1 of https://codereview.chromium.org/1005173004/)
Reason for revert:
arrrg. this is a staging nightmare. override required on the chrome side. must revert (again)

Original issue's description:
> Revert of Revert of Revert of Revert of Change device creation to see the (optional) layer-paint (patchset #1 id:1 of https://codereview.chromium.org/1001423002/)
>
> Reason for revert:
> chrome now has the new virtual, so trying again
>
> Original issue's description:
> > Revert of Revert of Revert of Change device creation to see the (optional) layer-paint (patchset #1 id:1 of https://codereview.chromium.org/1006923002/)
> >
> > Reason for revert:
> > platform_canvas tests failures
> >
> > skia_unittests (with patch) skia_unittests (with patch) PlatformCanvas.TranslateLayer failed 2
> > Flakiness dashboard
> >
> > failures:
> > PlatformCanvas.TranslateLayer
> > PlatformCanvas.FillLayer
> >
> > Original issue's description:
> > > Revert of Revert of Change device creation to see the (optional) layer-paint (patchset #1 id:1 of https://codereview.chromium.org/1008863002/)
> > >
> > > Reason for revert:
> > > guard in chrome has landed
> > >
> > > Original issue's description:
> > > > Revert of Change device creation to see the (optional) layer-paint (patchset #9 id:160001 of https://codereview.chromium.org/988413003/)
> > > >
> > > > Reason for revert:
> > > > need to have chrome opt-in for the older API before this can land (in chrome)
> > > >
> > > > Original issue's description:
> > > > > Change device creation to see the (optional) layer-paint
> > > > >
> > > > > Motivation:
> > > > >
> > > > > PDFDevice currently relies on 1) being told that the layer's paint has an imagefilter, and in the case, it creates a rasterdevice. It then relies on (2) canvas itself sniffing the layer's paint and offering to apply-the-imagefilter to call drawSprite instead of drawDevice.
> > > > >
> > > > > This subtle interchange is fragile, and also does not support other unsupported PDF features like colorfilters. This CL is a step toward making this use-raster-instead-of-native approach to layers more completely in the subclass' hands.
> > > > >
> > > > > Committed: https://skia.googlesource.com/skia/+/1182d9a96b80bd12183ee7c81325a979a51ee0c0
> > > >
> > > > TBR=halcanary@google.com,senorblanco@google.com,robertphillips@google.com
> > > > NOPRESUBMIT=true
> > > > NOTREECHECKS=true
> > > > NOTRY=true
> > > >
> > > > Committed: https://skia.googlesource.com/skia/+/0e040f7da2fdfeb49aa60d24117306e3b1e6ea90
> > >
> > > TBR=halcanary@google.com,senorblanco@google.com,robertphillips@google.com
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > >
> > > Committed: https://skia.googlesource.com/skia/+/f7076a13e2d4269903b34ef2780e1c84723e4477
> >
> > TBR=halcanary@google.com,senorblanco@google.com,robertphillips@google.com
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > NOTRY=true
> >
> > Committed: https://skia.googlesource.com/skia/+/8e14d660b2a434bc708a70180c84210883611683
>
> TBR=halcanary@google.com,senorblanco@google.com,robertphillips@google.com,reed@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Committed: https://skia.googlesource.com/skia/+/307d1ed129ff75eb64137dea75df858f9e250b69

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

Review URL: https://codereview.chromium.org/1005183003
2015-03-13 20:05:18 -07:00
reed
307d1ed129 Revert of Revert of Revert of Revert of Change device creation to see the (optional) layer-paint (patchset #1 id:1 of https://codereview.chromium.org/1001423002/)
Reason for revert:
chrome now has the new virtual, so trying again

Original issue's description:
> Revert of Revert of Revert of Change device creation to see the (optional) layer-paint (patchset #1 id:1 of https://codereview.chromium.org/1006923002/)
>
> Reason for revert:
> platform_canvas tests failures
>
> skia_unittests (with patch) skia_unittests (with patch) PlatformCanvas.TranslateLayer failed 2
> Flakiness dashboard
>
> failures:
> PlatformCanvas.TranslateLayer
> PlatformCanvas.FillLayer
>
> Original issue's description:
> > Revert of Revert of Change device creation to see the (optional) layer-paint (patchset #1 id:1 of https://codereview.chromium.org/1008863002/)
> >
> > Reason for revert:
> > guard in chrome has landed
> >
> > Original issue's description:
> > > Revert of Change device creation to see the (optional) layer-paint (patchset #9 id:160001 of https://codereview.chromium.org/988413003/)
> > >
> > > Reason for revert:
> > > need to have chrome opt-in for the older API before this can land (in chrome)
> > >
> > > Original issue's description:
> > > > Change device creation to see the (optional) layer-paint
> > > >
> > > > Motivation:
> > > >
> > > > PDFDevice currently relies on 1) being told that the layer's paint has an imagefilter, and in the case, it creates a rasterdevice. It then relies on (2) canvas itself sniffing the layer's paint and offering to apply-the-imagefilter to call drawSprite instead of drawDevice.
> > > >
> > > > This subtle interchange is fragile, and also does not support other unsupported PDF features like colorfilters. This CL is a step toward making this use-raster-instead-of-native approach to layers more completely in the subclass' hands.
> > > >
> > > > Committed: https://skia.googlesource.com/skia/+/1182d9a96b80bd12183ee7c81325a979a51ee0c0
> > >
> > > TBR=halcanary@google.com,senorblanco@google.com,robertphillips@google.com
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > >
> > > Committed: https://skia.googlesource.com/skia/+/0e040f7da2fdfeb49aa60d24117306e3b1e6ea90
> >
> > TBR=halcanary@google.com,senorblanco@google.com,robertphillips@google.com
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > NOTRY=true
> >
> > Committed: https://skia.googlesource.com/skia/+/f7076a13e2d4269903b34ef2780e1c84723e4477
>
> TBR=halcanary@google.com,senorblanco@google.com,robertphillips@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Committed: https://skia.googlesource.com/skia/+/8e14d660b2a434bc708a70180c84210883611683

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

Review URL: https://codereview.chromium.org/1005173004
2015-03-13 19:52:59 -07:00
reed
8e14d660b2 Revert of Revert of Revert of Change device creation to see the (optional) layer-paint (patchset #1 id:1 of https://codereview.chromium.org/1006923002/)
Reason for revert:
platform_canvas tests failures

skia_unittests (with patch) skia_unittests (with patch) PlatformCanvas.TranslateLayer failed 2
Flakiness dashboard

failures:
PlatformCanvas.TranslateLayer
PlatformCanvas.FillLayer

Original issue's description:
> Revert of Revert of Change device creation to see the (optional) layer-paint (patchset #1 id:1 of https://codereview.chromium.org/1008863002/)
>
> Reason for revert:
> guard in chrome has landed
>
> Original issue's description:
> > Revert of Change device creation to see the (optional) layer-paint (patchset #9 id:160001 of https://codereview.chromium.org/988413003/)
> >
> > Reason for revert:
> > need to have chrome opt-in for the older API before this can land (in chrome)
> >
> > Original issue's description:
> > > Change device creation to see the (optional) layer-paint
> > >
> > > Motivation:
> > >
> > > PDFDevice currently relies on 1) being told that the layer's paint has an imagefilter, and in the case, it creates a rasterdevice. It then relies on (2) canvas itself sniffing the layer's paint and offering to apply-the-imagefilter to call drawSprite instead of drawDevice.
> > >
> > > This subtle interchange is fragile, and also does not support other unsupported PDF features like colorfilters. This CL is a step toward making this use-raster-instead-of-native approach to layers more completely in the subclass' hands.
> > >
> > > Committed: https://skia.googlesource.com/skia/+/1182d9a96b80bd12183ee7c81325a979a51ee0c0
> >
> > TBR=halcanary@google.com,senorblanco@google.com,robertphillips@google.com
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > NOTRY=true
> >
> > Committed: https://skia.googlesource.com/skia/+/0e040f7da2fdfeb49aa60d24117306e3b1e6ea90
>
> TBR=halcanary@google.com,senorblanco@google.com,robertphillips@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Committed: https://skia.googlesource.com/skia/+/f7076a13e2d4269903b34ef2780e1c84723e4477

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

Review URL: https://codereview.chromium.org/1001423002
2015-03-13 12:34:32 -07:00
reed
f7076a13e2 Revert of Revert of Change device creation to see the (optional) layer-paint (patchset #1 id:1 of https://codereview.chromium.org/1008863002/)
Reason for revert:
guard in chrome has landed

Original issue's description:
> Revert of Change device creation to see the (optional) layer-paint (patchset #9 id:160001 of https://codereview.chromium.org/988413003/)
>
> Reason for revert:
> need to have chrome opt-in for the older API before this can land (in chrome)
>
> Original issue's description:
> > Change device creation to see the (optional) layer-paint
> >
> > Motivation:
> >
> > PDFDevice currently relies on 1) being told that the layer's paint has an imagefilter, and in the case, it creates a rasterdevice. It then relies on (2) canvas itself sniffing the layer's paint and offering to apply-the-imagefilter to call drawSprite instead of drawDevice.
> >
> > This subtle interchange is fragile, and also does not support other unsupported PDF features like colorfilters. This CL is a step toward making this use-raster-instead-of-native approach to layers more completely in the subclass' hands.
> >
> > Committed: https://skia.googlesource.com/skia/+/1182d9a96b80bd12183ee7c81325a979a51ee0c0
>
> TBR=halcanary@google.com,senorblanco@google.com,robertphillips@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Committed: https://skia.googlesource.com/skia/+/0e040f7da2fdfeb49aa60d24117306e3b1e6ea90

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

Review URL: https://codereview.chromium.org/1006923002
2015-03-13 08:46:12 -07:00
joshualitt
fd45079314 Call to retrieve SkDescriptor for SkScalarContext from SkPaint.
Review URL: https://codereview.chromium.org/1005103003
2015-03-13 08:38:43 -07:00
reed
0e040f7da2 Revert of Change device creation to see the (optional) layer-paint (patchset #9 id:160001 of https://codereview.chromium.org/988413003/)
Reason for revert:
need to have chrome opt-in for the older API before this can land (in chrome)

Original issue's description:
> Change device creation to see the (optional) layer-paint
>
> Motivation:
>
> PDFDevice currently relies on 1) being told that the layer's paint has an imagefilter, and in the case, it creates a rasterdevice. It then relies on (2) canvas itself sniffing the layer's paint and offering to apply-the-imagefilter to call drawSprite instead of drawDevice.
>
> This subtle interchange is fragile, and also does not support other unsupported PDF features like colorfilters. This CL is a step toward making this use-raster-instead-of-native approach to layers more completely in the subclass' hands.
>
> Committed: https://skia.googlesource.com/skia/+/1182d9a96b80bd12183ee7c81325a979a51ee0c0

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

Review URL: https://codereview.chromium.org/1008863002
2015-03-13 07:28:29 -07:00
reed
1182d9a96b Change device creation to see the (optional) layer-paint
Motivation:

PDFDevice currently relies on 1) being told that the layer's paint has an imagefilter, and in the case, it creates a rasterdevice. It then relies on (2) canvas itself sniffing the layer's paint and offering to apply-the-imagefilter to call drawSprite instead of drawDevice.

This subtle interchange is fragile, and also does not support other unsupported PDF features like colorfilters. This CL is a step toward making this use-raster-instead-of-native approach to layers more completely in the subclass' hands.

Review URL: https://codereview.chromium.org/988413003
2015-03-13 07:16:09 -07:00
reed
11fa2247b7 some utils for rect and matrix
BUG=skia:

Review URL: https://codereview.chromium.org/1003813003
2015-03-13 06:08:28 -07:00
mtklein
172b45518a Clean up SkDynamicAnnotations.
Unprotected reads -> relaxed reads.
    Unprotected write -> relaxed write.

The only unprotected write we had was in SkTraceEvent, which it looks like we nabbed from Chrome at some point and changed only to silence TSAN.  Chrome's version uses AtomicWord / NoBarrier_Load / NoBarrier_Store, which boils down to the same as here, intptr_t / relaxed load / relaxed store.

This leaves one place where we're lying a bit to TSAN, in include/core/SkLazyPtr.h where we're doing a data-dependent consume load.  We're telling TSAN it's consume, but telling any other compiler to compile it as relaxed, given how they all upgrade consume to acquire.  This eliminates a barrier for us on ARM.  How do you guys deal with this?  Just use a consume memory order, take the hit, and hope compilers get smarter one day?

BUG=chromium:465721

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

Review URL: https://codereview.chromium.org/996763002
2015-03-12 05:27:46 -07:00
bungeman
79738cc7bf Glyph positions maintain 32 bit integer part.
A glyph position when mapped from canvas space to device space may land
outside the bounds of the current 16 bit integer part of device space.
Device space is already limited to 32 bits for the integer part,
but for a short space in drawText and drawPosText it is currently
limited to 16 bits (SkFixed). Raise this limit by moving to 48.16.
This matches the current similar fix for measureText.

BUG=chromium:375322

Review URL: https://codereview.chromium.org/977623002
2015-03-11 14:05:29 -07:00
bungeman
167eb17cd6 Use SkTMin and SkTMax for clamp/pin.
This changes SkScalarClampMax and SkScalarPin to use SkTMin and SkTMax.
This change allows compilers to more easily transform these operations
into fast max/min operarations as opposed to conditional branches.

Review URL: https://codereview.chromium.org/993593002
2015-03-09 13:40:15 -07:00
reed
cedc36f18b Use ComposColorFilter to collaps hierarchy (when possible).
Clarify asColorFilter ...
1. Rename to isColorFilterNode for DAG reduction
2. Add asAColorFilter for removing the imagefilter entirely (future use-case)

Need layouttest rebaseline suppression before this can land in chrome...
https://codereview.chromium.org/984023004/

BUG=skia:

Review URL: https://codereview.chromium.org/982933002
2015-03-08 04:42:52 -07:00
tomhudson
64de1e1790 ViaAndroidSDK for DM
Make a Via for DM which transforms a set of draws to be more like what
we'd see through the Android Framework's HWUI API. Only built inside
Android's framework because we depend on HWUI classes for half of
those transformations.

Tested with --config androidsdk-8888 and --config androidsdk-hwui.

R=djsollen@google.com,mtklein@google.com,reed@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/974913002
2015-03-05 08:01:07 -08:00
reed
dc812222a7 add impl limit for number of leaf-nodes in composecolorfilter
BUG=skia:

Review URL: https://codereview.chromium.org/972153010
2015-03-05 07:21:02 -08:00
kkinnunen
a9baa652bb Revert of Add image as a draw type that can be filtered (patchset #4 id:60001 of https://codereview.chromium.org/960783003/)
Reason for revert:
Fails on mac for some reason.
Also is a bit wrong, but this should not be reason for the failure..

Original issue's description:
> Add image as a draw type that can be filtered
>
> Add image as a draw type that can be filtered.
>
> This is needed when SkImage is added as an object to be drawn so that
> the draw is forwarded to SkBaseDevice. This would be used in making
> filters use SkImages.
>
> BUG=skia:3388
>
> Committed: https://skia.googlesource.com/skia/+/fa77eb1e51b9317ff993d1be504ada173b561e5f

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

Review URL: https://codereview.chromium.org/980273002
2015-03-05 06:33:54 -08:00
kkinnunen
fa77eb1e51 Add image as a draw type that can be filtered
Add image as a draw type that can be filtered.

This is needed when SkImage is added as an object to be drawn so that
the draw is forwarded to SkBaseDevice. This would be used in making
filters use SkImages.

BUG=skia:3388

Review URL: https://codereview.chromium.org/960783003
2015-03-05 00:39:45 -08:00
reed
b7affb56bb udpate dox for colorfilter fragment processor requirements
BUG=skia:
NOTRY=True

Review URL: https://codereview.chromium.org/961933003
2015-03-04 13:30:50 -08:00
fmalita
024f996c1d Text blob run paints should be filtered.
We're constructing blob run paints after the canvas draw filter has been
applied.

Instead, we need do defer text blob draw filters until we have access
to the full run paints.

BUG=skia:3494
R=reed@google.com,mtklein@google.com

Review URL: https://codereview.chromium.org/973973003
2015-03-03 19:08:17 -08:00
halcanary
47ef4d5d93 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.

Review URL: https://codereview.chromium.org/963953002
2015-03-03 09:13:09 -08:00
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