Commit Graph

4541 Commits

Author SHA1 Message Date
joshualitt
8f94bb2b25 remove old text contexts and fontcache
BUG=skia:

Review URL: https://codereview.chromium.org/1104343003
2015-04-28 07:04:11 -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
kkinnunen
1899651ffc Extract gpu line dashing to GrDashLinePathRenderer
Move line dashing logic from GrContext::drawPath to
GrDashLinePathRenderer. This makes it possible to let path renderers render arbitrary dashed paths.

End goal is to implement dashing in GrStencilAndCoverPathRenderer.

Review URL: https://codereview.chromium.org/1100073003
2015-04-26 23:18:50 -07:00
robertphillips
91df6c273a Fix some lingering typos
Review URL: https://codereview.chromium.org/1101293003
2015-04-24 11:10:51 -07:00
cdalton
f4f2b44222 Add onGetBlendInfo to GrXferProcessor
Adds an onGetBlendInfo method for GrXferProcessor subclasses to
override instead of overriding getBlendInfo directly. This gives the
base class a chance to initialize the struct with default values
before passing it on. As the BlendInfo struct grows, this will keep
things simple and less error prone.

BUG=skia:
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1049143002
2015-04-23 09:40:23 -07:00
fmalita
632e92fc3f [SkPDFDevice] Enable pathops-based inverse fills
Keeping the old compile guard for clipping only.

BUG=skia:3749
R=halcanary@google.com,caryclark@google.com,reed@google.com

Review URL: https://codereview.chromium.org/1099953002
2015-04-22 15:02:04 -07:00
cdalton
bae6f6c3ec Add tokens and entry points for KHR_blend_equation_advanced
Also adds glBlendEquation, which the extension interacts with, to the
core of GrGLInterface. Validation of this function is temporarily
disabled until Chrome hooks it up.

BUG=skia:

Review URL: https://codereview.chromium.org/1039693004
2015-04-22 10:39:03 -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
tomhudson
2575f317d3 Revert of Add tokens and entry points for KHR_blend_equation_advanced (patchset #3 id:40001 of https://codereview.chromium.org/1039693004/)
Reason for revert:
We're getting repeated crashes since this CL landed when we try to evaluate a roll into Chrome on our bots. (https://uberchromegw.corp.google.com/i/client.skia/builders/Linux%20Tests/builds/1902)

Our initial reflex is to put a #if 0 around this code (just like the immediately following lines 334-338 in GrGLInterface.cpp), but the error isn't what the GPU team expected to see if that was all we needed, so we're reverting now and asking you to resubmit tomorrow after running more thorough tests.

Original issue's description:
> Add tokens and entry points for KHR_blend_equation_advanced
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/8e578859f80b46a63144add215955221017d3609

TBR=markkilgard@gmail.com,bsalomon@google.com,cdalton@nvidia.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1101593002
2015-04-21 14:16:53 -07:00
cdalton
8e578859f8 Add tokens and entry points for KHR_blend_equation_advanced
BUG=skia:

Review URL: https://codereview.chromium.org/1039693004
2015-04-21 12:34:09 -07:00
cdalton
fd4167ddf1 Import glTextureBarrier
BUG=skia:

Review URL: https://codereview.chromium.org/1090163002
2015-04-21 11:45:56 -07:00
mtklein
59bcfaed66 Split default and user-supplied event tracers.
Chrome's got a test scenario where setting the user-supplied tracer is racing with a concurrent use of the default tracer.

BUG=chromium:437044

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

Review URL: https://codereview.chromium.org/1099123002
2015-04-21 09:38:03 -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
reed
ca1a22ee53 Revert of Revert of remove unused (by clients) SkPathUtils (patchset #1 id:1 of https://codereview.chromium.org/1060703003/)
Reason for revert:
fix (removal from gypi/gn files) has landed in chrome.

Original issue's description:
> Revert of remove unused (by clients) SkPathUtils (patchset #1 id:1 of https://codereview.chromium.org/1088383003/)
>
> Reason for revert:
> This change is causing the DEPS roll to fail:
>
>
> http://build.chromium.org/p/tryserver.chromium.linux/builders/android_chromium_gn_compile_rel/builds/78771/steps/gn/logs/stdio
>
> Original issue's description:
> > remove unused (by clients) SkPathUtils
> >
> > BUG=skia:
> >
> > Committed: https://skia.googlesource.com/skia/+/aab35d91b8b80acd1902594bbf542083fdfa4bb7
>
> TBR=scroggo@google.com,reed@chromium.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/bdb0bf5f8858043878d8a4fa8130c6c87bef3fd4

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

Review URL: https://codereview.chromium.org/1091963002
2015-04-16 20:10:55 -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
egdaniel
8dc7c3a839 Rename GrStencilBuffer to GrStencilAttachment
BUG=skia:

Review URL: https://codereview.chromium.org/1083133002
2015-04-16 11:22:42 -07:00
jcgregorio
bdb0bf5f88 Revert of remove unused (by clients) SkPathUtils (patchset #1 id:1 of https://codereview.chromium.org/1088383003/)
Reason for revert:
This change is causing the DEPS roll to fail:

http://build.chromium.org/p/tryserver.chromium.linux/builders/android_chromium_gn_compile_rel/builds/78771/steps/gn/logs/stdio

Original issue's description:
> remove unused (by clients) SkPathUtils
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/aab35d91b8b80acd1902594bbf542083fdfa4bb7

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

Review URL: https://codereview.chromium.org/1060703003
2015-04-16 09:47:36 -07:00
reed
aab35d91b8 remove unused (by clients) SkPathUtils
BUG=skia:

Review URL: https://codereview.chromium.org/1088383003
2015-04-16 06:16:38 -07:00
bsalomon
bed83a66f5 Don't draw if SkShader::asNewFragmentProcessor fails.
BUG=chromium:473156

Review URL: https://codereview.chromium.org/1089063002
2015-04-15 14:18:34 -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
joshualitt
0db6dfaeb2 The TextBlobCache needs the ability to trigger a flush because otherwise its entire budget can be used up, but it will not be able to free up any space due to blobs being stuck in the GrInOrderDrawBuffer. This was causing a segfault. After this CL the cache will try to purge, and then flush if it cannot purge enough. It will not purge the most recent addition to the cache.
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1071333002
2015-04-10 07:01:30 -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
robertphillips
e275fdf812 Add GM to repro crbug.com/472795
This CL also adds a new parameter to SkBitmapSource which gives the user control of the filter quality.

BUG=472795

Review URL: https://codereview.chromium.org/1072603002
2015-04-09 06:47:12 -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
bsalomon
3f324321cd Add mechanism to proactively purge old resources in GrResourceCache.
This change leaves the feature turned off by default.

Review URL: https://codereview.chromium.org/1032873002
2015-04-08 11:01:55 -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
scroggo
5965b73e54 Revert of Remove now-redundant SkPathOps enum. (patchset #1 id:1 of https://codereview.chromium.org/1051113005/)
Reason for revert:
Android is still using this. See 4c2968b94c/logs/build_error.log

Original issue's description:
> Remove now-redundant SkPathOps enum.
>
> R=caryclark,reed
> BUG=473772
>
> Committed: https://skia.googlesource.com/skia/+/143244e27d95255807d8fa505ce0affef96d1fc8

TBR=caryclark@google.com,reed@google.com,schenney@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=473772

Review URL: https://codereview.chromium.org/1068873002
2015-04-07 06:53:21 -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
schenney
143244e27d Remove now-redundant SkPathOps enum.
R=caryclark,reed
BUG=473772

Review URL: https://codereview.chromium.org/1051113005
2015-04-06 09:37:56 -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
bsalomon
c9c3e62b4e Add constant color GrFP.
Committed: https://skia.googlesource.com/skia/+/dfbbec436cbcacc3270d4b28357c8393e67d6494

Review URL: https://codereview.chromium.org/978713002
2015-04-02 11:12:09 -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
bsalomon
599ea40cec Revert of Add constant color GrFP. (patchset #10 id:180001 of https://codereview.chromium.org/978713002/)
Reason for revert:
Revert while investigating assertions.

Original issue's description:
> Add constant color GrFP.
>
> Committed: https://skia.googlesource.com/skia/+/dfbbec436cbcacc3270d4b28357c8393e67d6494

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

Review URL: https://codereview.chromium.org/1055023002
2015-04-02 08:33:54 -07:00
bsalomon
dfbbec436c Add constant color GrFP.
Review URL: https://codereview.chromium.org/978713002
2015-04-01 14:54:57 -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
scroggo
5842154480 SkCodec::onGetScanlineDecoder must call rewind.
This mirrors the behavior in onGetPixels, and allows the implementation
to share code for handling calls to rewindIfNeeded.

This also fixes a bug where getScanlineDecoder was calling
rewindIfNeeded and treating the result as a bool.

In SkPngCodec, factor out the code to call rewindIfNeeded, and call it
in both onGetPixels and onGetScanlineDecoder.

Update the test to include testing the scanline decoder. Rename "gen"
to "codec" now that it must be an SkCodec.

BUG=skia:3257

Depends on https://codereview.chromium.org/1048423003/ (DIFFERENT ISSUE).

Review URL: https://codereview.chromium.org/1050893002
2015-04-01 11:25:20 -07:00
vbuzinov
08b4d29a0a GrGLInterface: Add support for NV_framebuffer_mixed_samples
Import glCoverageModulation if NV_framebuffer_mixed samples
is available

BUG=skia:3177

Review URL: https://codereview.chromium.org/993363002
2015-04-01 06:29:49 -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
halcanary
af9c85dee1 SkPDF: remove SK_NO_FLATE & dead code in SkPDFStream
SkPDFStream copy constructor
    SkPDFStream Substitute mechanism
    SkPDFStream::setData(NULL);
    SkPDFStream SK_NO_FLATE logic

BUG=skia:3585
TBR=bsalomon@google.com,reed@google.com

Review URL: https://codereview.chromium.org/1041183002
2015-03-31 08:22:01 -07:00
mtklein
c9adb05b64 Refactor Sk2x<T> + Sk4x<T> into SkNf<N,T> and SkNi<N,T>
The primary feature this delivers is SkNf and SkNd for arbitrary power-of-two N.  Non-specialized types or types larger than 128 bits should now Just Work (and we can drop in a specialization to make them faster).  Sk4s is now just a typedef for SkNf<4, SkScalar>; Sk4d is SkNf<4, double>, Sk2f SkNf<2, float>, etc.

This also makes implementing new specializations easier and more encapsulated.  We're now using template specialization, which means the specialized versions don't have to leak out so much from SkNx_sse.h  and SkNx_neon.h.

This design leaves us room to grow up, e.g to SkNf<8, SkScalar> == Sk8s, and to grown down too, to things like SkNi<8, uint16_t> == Sk8h.

To simplify things, I've stripped away most APIs (swizzles, casts, reinterpret_casts) that no one's using yet.  I will happily add them back if they seem useful.

You shouldn't feel bad about using any of the typedef Sk4s, Sk4f, Sk4d, Sk2s, Sk2f, Sk2d, Sk4i, etc.  Here's how you should feel:
  - Sk4f, Sk4s, Sk2d: feel awesome
  - Sk2f, Sk2s, Sk4d: feel pretty good

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

BUG=skia:3592

Review URL: https://codereview.chromium.org/1048593002
2015-03-30 10:50:27 -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
halcanary
a096d7a6d0 SkCodec: add wbmp class
Review URL: https://codereview.chromium.org/1006583005
2015-03-27 12:16:53 -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
caryclark
d8bc16b306 add legacy pathop enums; fix uninitialized warning
R=reed@google.com
BUG=skia:3588
NOTREECHECKS=true
NOTRY=true
NOPRESUBMIT=true

Review URL: https://codereview.chromium.org/1034073004
2015-03-26 09:05:12 -07:00
caryclark
54359294a7 cumulative pathops patch
Replace the implicit curve intersection with a geometric curve intersection. The implicit intersection proved mathematically unstable and took a long time to zero in on an answer.

Use pointers instead of indices to refer to parts of curves. Indices required awkward renumbering.

Unify t and point values so that small intervals can be eliminated in one pass.

Break cubics up front to eliminate loops and cusps.

Make the Simplify and Op code more regular and eliminate arbitrary differences.

Add a builder that takes an array of paths and operators.

Delete unused code.

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

Review URL: https://codereview.chromium.org/1037573004
2015-03-26 07:52:43 -07:00
fmalita
65cdb57ae8 Add a paint filter utility canvas (SkPaintFilterCanvas)
Introduce a paint filter proxy base class as a SkDrawFilter replacement,
and convert SkDebugCanvas to use the new approach.

BUG=skia:3587
R=reed@google.com,mtklein@google.com,robertphillips@google.com,tomhudson@google.com

Review URL: https://codereview.chromium.org/1032173002
2015-03-26 07:24:48 -07:00
halcanary
b880d7f87e SkCodec: conditionally remove fInfo
Review URL: https://codereview.chromium.org/1029423005
2015-03-26 06:29:03 -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
djsollen
59f9ec7e9c Replace error checking mutex initializer with the glibc-compatible version
No public API changes.
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1038733002
2015-03-25 13:47:13 -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
scroggo
05245900bf Add scanline decoding to SkCodec.
Add an interface for decoding scanlines, and implement that interface
in the PNG decoder.

Use a separate method to determine whether an image that used a type
with alpha was actually opaque.

SkScanlineDecoder.h:
New interface for decoding scanlines.

SkCodec.h:
Add getScanlineDecoder.
Add a virtual function (with non-virtual caller) for determining
whether the image truly had alpha. The client can call this to
determine if the image was actually opaque if it reported having alpha.
Remove code to sneakily change the passed in alpha type.

SkCodec_libpng.*:
Split up code onGetPixels into helper functions that can be shared with
the scanline decoder.
Implement scanline decoding.
Implement onReallyHasAlpha.

SkSwizzler.*:
Add a new SrcConfig as a default, which is invalid.
Add a function for setting fDstRow directly.
Assert fDstRow is not NULL.

BUG=skia:3257

Review URL: https://codereview.chromium.org/1010903003
2015-03-25 11:11:52 -07:00
msarett
9bde918754 Enabling ico decoding with use of png and bmp decoders
BUG=skia:3257

NOPRESUBMIT=true

Review URL: https://codereview.chromium.org/1011343003
2015-03-25 05:27:48 -07:00
reed
0dc4dd6dda Revert of pathops version two (patchset #16 id:150001 of https://codereview.chromium.org/1002693002/)
Reason for revert:
ASAN investigation

Original issue's description:
> pathops version two
>
> R=reed@google.com
>
> marked 'no commit' to attempt to get trybots to run
>
> TBR=reed@google.com
>
> Committed: https://skia.googlesource.com/skia/+/ccec0f958ffc71a9986d236bc2eb335cb2111119

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

Review URL: https://codereview.chromium.org/1029993002
2015-03-24 13:55:33 -07:00
tomhudson
7aa846c683 Revert of Enabling ico decoding with use of png and bmp decoders (patchset #10 id:280001 of https://codereview.chromium.org/1011343003/)
Reason for revert:
Reverting on suspicion of massive bot failures - possible command line too long?

Original issue's description:
> Enabling ico decoding with use of png and bmp decoders
>
> BUG=skia:3257
>
> Committed: https://skia.googlesource.com/skia/+/15bfd075d38e4422a477e22940d06a137f66cc97

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

Review URL: https://codereview.chromium.org/1022843005
2015-03-24 13:47:41 -07:00
msarett
15bfd075d3 Enabling ico decoding with use of png and bmp decoders
BUG=skia:3257

Review URL: https://codereview.chromium.org/1011343003
2015-03-24 12:24:27 -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
caryclark
ccec0f958f pathops version two
R=reed@google.com

marked 'no commit' to attempt to get trybots to run

TBR=reed@google.com

Review URL: https://codereview.chromium.org/1002693002
2015-03-24 07:28:17 -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
b67eb2f9b9 Revert "Revert of impl colormatrix w/ floats (patchset #7 id:120001 of https://codereview.chromium.org/967943002/)"
disabled for the momment -- need to understand arm64 glitches

This reverts commit 374a4c3b74.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1028403002
2015-03-24 04:13:45 -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
374a4c3b74 Revert of impl colormatrix w/ floats (patchset #7 id:120001 of https://codereview.chromium.org/967943002/)
Reason for revert:
Arm64 seems to be having glitches :(

See gm:colormatrix on Arm64/TegraK1/Nexus9

last square should be all white, but it has stripes

Original issue's description:
> impl colormatrix w/ floats
>
> this needs to land first https://codereview.chromium.org/1031713003
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/7971def11be91ed08eae7107b372322d24e67544

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

Review URL: https://codereview.chromium.org/1030743003
2015-03-23 18:52:57 -07:00
reed
7971def11b impl colormatrix w/ floats
this needs to land first https://codereview.chromium.org/1031713003

BUG=skia:

Review URL: https://codereview.chromium.org/967943002
2015-03-23 14:35:25 -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
senorblanco
977b6f7e7b Remove deprecated flavour of SkDropShadowImageFilter::Create().
Review URL: https://codereview.chromium.org/1026603002
2015-03-20 06:38:00 -07:00
reed
adf9990cb5 add SkMatrix::decomposeScale
BUG=skia:

Review URL: https://codereview.chromium.org/1006173005
2015-03-19 16:10:54 -07:00
senorblanco
6c1b338827 Remove now-unused uniqueID param from SkDropShadowImageFilter::Create().
Also make both input & crop rect default NULL, as in other filter Create functions.

BUG=skia:

Review URL: https://codereview.chromium.org/1016343002
2015-03-19 13:39:19 -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
fffeedefbb Implement SkCodec::getScaledDimensions.
Left out of a prior CL since no one was calling it...

Review URL: https://codereview.chromium.org/995303004
2015-03-18 10:50:37 -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
bsalomon
6f7f2012ee Move GrAutoLocaleSetter to new file and fix issue with null locale
TBR=egdaniel@google.com
NOTREECHECKS=true

Review URL: https://codereview.chromium.org/1002623004
2015-03-16 14:00:52 -07:00
reed
82b0748f1c remove dead code
BUG=skia:

Review URL: https://codereview.chromium.org/1016523002
2015-03-16 13:56:42 -07:00
Brian Salomon
95a4fe3737 always reset locale (not just in debug).
BUG=skia:

Review URL: https://codereview.chromium.org/1007283009
2015-03-16 15:36:44 -04:00
Brian Salomon
f33a8bf31e fix ios build wrt locale?
BUG=skia:3330

Review URL: https://codereview.chromium.org/1012773004
2015-03-16 15:05:23 -04:00
bsalomon
3318ee7d5e Use C locale for numerics when emitting shaders.
BUG=skia:3330

Review URL: https://codereview.chromium.org/1012723002
2015-03-16 11:56:29 -07:00
msarett
741143878b Revert "Revert of fix for invalid for loop syntax broke build (patchset #1 id:1 of https://codereview.chromium.org/1007373003/)"
This reverts commit d18475854c.

Revert "Revert "Implementation of image decoding for bmp files, in accordance with the new API.""

This reverts commit dfdec78a5d.

BUG=skia:

TBR=

Review URL: https://codereview.chromium.org/1016443003
2015-03-16 11:55:18 -07:00
msarett
dfdec78a5d Revert "Implementation of image decoding for bmp files, in accordance with the new API."
This reverts commit 3675874468.

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

Review URL: https://codereview.chromium.org/1012873002
2015-03-16 11:07:02 -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
msarett
3675874468 Implementation of image decoding for bmp files, in accordance with the new API.
Currently decodes to opaque and unpremul.

Tested on local test suite.

BUG=skia:3257

Review URL: https://codereview.chromium.org/947283002
2015-03-16 08:27:53 -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
joshualitt
d5b98404ec fix for valgrind preAbandonGpuContext
NOTREECHECKS=true

BUG=skia:

Review URL: https://codereview.chromium.org/997923002
2015-03-11 09:11:19 -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
bsalomon
bb3be25a86 Remove rect clip type from grclip.
R=joshualitt@google.com
BUG=skia:
NOTREECHECKS=true

Review URL: https://codereview.chromium.org/989443003
2015-03-06 08:21:39 -08:00
djsollen
961707f384 Remove SkPorterDuff now that Android has been updated.
BUG=skia:3178

Review URL: https://codereview.chromium.org/983743003
2015-03-05 12:42:29 -08:00
egdaniel
bdad9c34d8 Add flag to force gpu trace markers to be used and printed out for debugging.
BUG=skia:

Review URL: https://codereview.chromium.org/976413002
2015-03-05 12:19:17 -08: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
scroggo
f24f2247c2 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.

Requires a gclient sync to pull down libpng.

BUG=skia:3257

Committed: https://skia.googlesource.com/skia/+/ca358852b4fed656d11107b2aaf28318a4518b49
(and then reverted)

Review URL: https://codereview.chromium.org/930283002
2015-03-03 08:59:20 -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
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