Commit Graph

1434 Commits

Author SHA1 Message Date
Greg Daniel
d207345456 Add cap to number of oplists we execute before flushing to the gpu.
This fixes a crash we saw when we switch vulkan copies as draws to creating
their own secondary command buffer. The crash came from the perf blendmode
tests when using an advanced blend mode. They would do 1000 draws which forced
us into creating 2000 command buffers (since the dst copies and the normal draws
each used them). I tested without the copies as draws change and just increasing
the total number of draws we do and was able to repro the crash.

Besides fixing the above OOM crash, I am also seeing a 5-10% perf gain on the
blendmode micro benches which is nice

Bug: skia:
Change-Id: I9266ea0ba02a755f54dabd4ee804963ab0c9b684
Reviewed-on: https://skia-review.googlesource.com/c/175436
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-12-07 17:57:07 +00:00
Brian Salomon
967df200bd Deuninstantiate
Uninstantiated: a state of not being instantiated.

Deinstantiate: transition from instantiated to uninstantiated state.

Change-Id: Id7b6b295267674a9915f95105d73fabfcc3555de
Reviewed-on: https://skia-review.googlesource.com/c/175586
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-12-07 16:54:52 +00:00
Mike Klein
0ec1c571c8 remove sk_atomic_inc
Change-Id: I4960b1cd055daf44637e95825f82cb7fe2ce134a
Reviewed-on: https://skia-review.googlesource.com/c/174285
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-12-04 19:01:47 +00:00
Leon Scroggins III
a55445eab6 Simplify gn_args in gn_to_bp.py
Bug: b/118742766

This does not change Android.bp or (any) SkUserConfig.h. But it
consolidates the arguments for the different platforms into one method,
which makes it clear what they share and where they differ. It also no
longer sets skia_enable_tools for the non-Android build, where it
doesn't need to be set to true (this makes no difference in the final
output nor the time GN takes to generate JSON).

Change-Id: I22af345aaf3878227d4f42afc2861e49ec2691ec
Reviewed-on: https://skia-review.googlesource.com/c/173238
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-12-04 16:04:02 +00:00
Mike Klein
f8dfe4cbbf clean up SkBitmapProcState::platformProcs()
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Change-Id: Ief41c0442ce37ba0350d070a66a103095c07083c
Reviewed-on: https://skia-review.googlesource.com/c/172420
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-12-03 21:24:31 +00:00
Brian Osman
c32aeb326e Fix two GPU image filters handling of subset inputs
Added a GM that demonstrates the bug. Should draw a blur with
the center masked out, and a circular blurry shape that's
roughly the inverse. On raster, this was already the result.
On GPU, the blurred/eroded layer becomes a subset with an
origin other than (0,0), and that layer was shifted.

I *think* this is the correct fix - we are including 'offset'
in the texture matrices, but that's just based on the crop
rects and adjustments from each filter. We still need to adjust
the texture coords for the subsets themselves.

Bug: chromium:905548
Change-Id: I19c936adad90311aef243a9395a270d2e015df2f
Reviewed-on: https://skia-review.googlesource.com/c/173321
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2018-12-03 16:46:29 +00:00
Greg Daniel
7e000220c3 Reland "Add support for Ycbcr Conversion Samplers in vulkan."
This is a reland of 6cd74900da

Original change's description:
> Add support for Ycbcr Conversion Samplers in vulkan.
> 
> The only thing missing from this CL is that we need to bake the
> ycbcr conversion samplers into the VkPipeline when we create it. As that
> is a larger change, that will be broken up into a few follow on CLs.
> 
> Currently this only supports ycbcr conversion samplers when used with
> external textures.
> 
> Bug: skia:
> Change-Id: I23e95b19469093072589ebbbfb7926ab79dcdea9
> Reviewed-on: https://skia-review.googlesource.com/c/164602
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

Bug: skia:
Change-Id: I943398077775ef6396fbe5cb9196d23a29128669
Reviewed-on: https://skia-review.googlesource.com/c/173986
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-12-03 16:16:55 +00:00
Greg Daniel
f4bf973592 Revert "Add support for Ycbcr Conversion Samplers in vulkan."
This reverts commit 6cd74900da.

Reason for revert: breaking win vulkan bots

Original change's description:
> Add support for Ycbcr Conversion Samplers in vulkan.
> 
> The only thing missing from this CL is that we need to bake the
> ycbcr conversion samplers into the VkPipeline when we create it. As that
> is a larger change, that will be broken up into a few follow on CLs.
> 
> Currently this only supports ycbcr conversion samplers when used with
> external textures.
> 
> Bug: skia:
> Change-Id: I23e95b19469093072589ebbbfb7926ab79dcdea9
> Reviewed-on: https://skia-review.googlesource.com/c/164602
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com

Change-Id: Ib56905821cbfd40cf30ec89269b551ce01605a1a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/173982
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-12-03 14:34:45 +00:00
Greg Daniel
6cd74900da Add support for Ycbcr Conversion Samplers in vulkan.
The only thing missing from this CL is that we need to bake the
ycbcr conversion samplers into the VkPipeline when we create it. As that
is a larger change, that will be broken up into a few follow on CLs.

Currently this only supports ycbcr conversion samplers when used with
external textures.

Bug: skia:
Change-Id: I23e95b19469093072589ebbbfb7926ab79dcdea9
Reviewed-on: https://skia-review.googlesource.com/c/164602
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-12-03 14:13:42 +00:00
Ben Wagner
06602e7b73 Remove FontScalerTest sample.
This sample has had a gm counterpart for a long time now, and is also full
of dead code. It isn't adding anything to our understanding of Skia, so
remove it.

Change-Id: I6f3b0ff454b603815d66480ec11c8426717578be
Reviewed-on: https://skia-review.googlesource.com/c/173764
Commit-Queue: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Auto-Submit: Ben Wagner <bungeman@google.com>
2018-11-30 21:30:34 +00:00
Kevin Lubick
50ff7a56d1 gn format gn/opts.gni
Bug: skia:
Change-Id: I1c001244dbc682c93278687a0378c59403845d0d
Reviewed-on: https://skia-review.googlesource.com/c/173235
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-11-28 20:49:05 +00:00
Michael Ludwig
6985853f88 Reland "Initial definition of fill rect op"
This reverts commit 1a2476d294.

Reason for revert: Fixes printf signatures and asserts.

Original change's description:
> Revert "Initial definition of fill rect op"
> 
> This reverts commit d3c92d9a36.
> 
> Reason for revert: printf build failure on gcc, assert failures on CQ
> 
> Original change's description:
> > Initial definition of fill rect op
> > 
> > Bug: skia:
> > Change-Id: Ie0c99eb5163501853d1adc885bd3841f90a71924
> > Reviewed-on: https://skia-review.googlesource.com/c/163486
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> 
> TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com
> 
> Change-Id: Ib32f91a39d91aeb87982a7b19719485e4a1bf8ae
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/c/173233
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com

Change-Id: I415913a269ba5bcdebd169b5ebc3510673247bfd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/173234
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2018-11-28 20:38:25 +00:00
Mike Reed
c33ec9f8c4 remove legacy hinting-enum guards
Bug: skia:
Change-Id: I762fd834859fc6334b4eb36c1fad05538e873dd9
Reviewed-on: https://skia-review.googlesource.com/c/173229
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-11-28 20:15:03 +00:00
Michael Ludwig
1a2476d294 Revert "Initial definition of fill rect op"
This reverts commit d3c92d9a36.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Initial definition of fill rect op
> 
> Bug: skia:
> Change-Id: Ie0c99eb5163501853d1adc885bd3841f90a71924
> Reviewed-on: https://skia-review.googlesource.com/c/163486
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com

Change-Id: Ib32f91a39d91aeb87982a7b19719485e4a1bf8ae
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/173233
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2018-11-28 19:58:33 +00:00
Leon Scroggins III
85e22fc361 Build Android Framework host library on Mac
Based on ag/5616352, patch set 5.

Bug: b/118742766
Test: lunch sdk && mmma external/skia on Mac

Similar to the linux build, use a new set of GN arguments to create a
json object to fill in the updated template.

Add the new include/config/mac folder for the newly generated mac-
specific SkUserConfig.h.

Include stdarg.h in SkTraceEventCommon, which is necessary for the mac
build.

Add a new GN arg (skia_use_fonthost_mac) to allow framework build to
manually not build SkFontHost_mac.cpp, and use the same font host
as the other builds.

Change-Id: I654ba496306a3f3591c3937ad5524cd45e49dd65
Reviewed-on: https://skia-review.googlesource.com/c/173183
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-11-28 19:29:51 +00:00
Michael Ludwig
d3c92d9a36 Initial definition of fill rect op
Bug: skia:
Change-Id: Ie0c99eb5163501853d1adc885bd3841f90a71924
Reviewed-on: https://skia-review.googlesource.com/c/163486
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2018-11-28 19:08:34 +00:00
Mike Reed
fc614f1179 rm SK_SUPPORT_LEGACY_TEXTBLOBBUILD_WITH_PAINT from fluter
Bug: skia:
Change-Id: I47ccd1d6ea7334096bab97804728fd26674eed39
Reviewed-on: https://skia-review.googlesource.com/c/173222
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2018-11-28 15:59:15 +00:00
Mike Reed
46c774aa54 rm SK_SUPPORT_LEGACY_NESTED_HINTINGENUM from flutter
Bug: skia:
Change-Id: Id025fe6bd3aee7458c61678f803e19905c31333f
Reviewed-on: https://skia-review.googlesource.com/c/173221
Reviewed-by: Mike Reed <reed@google.com>
2018-11-28 15:50:27 +00:00
Brian Osman
017aa53068 Remove tonalshadows GMs
These aren't testing Skia core functionality

Bug: skia:7518
Change-Id: Ib564dc7b0aa8f137c2c40141fa5d7e9a1bfe4d64
Reviewed-on: https://skia-review.googlesource.com/c/172968
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-11-27 17:32:35 +00:00
Brian Osman
368895b0da Remove gamut GM
This was based on old ideas about color management. We have better
mechanisms for testing this now.

Bug: skia:
Change-Id: If59b5039f31ab0ebbdbed4205c941dd9266f67c1
Reviewed-on: https://skia-review.googlesource.com/c/172860
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-11-26 15:45:35 +00:00
Greg Daniel
54bfb18dad Privately include our version of vulkan header file in all our src files.
This should allow clients to include Skia and their vulkan files in any
order. However, it does require that when clients are building their
files that include skia with vulkan, they must have vulkan/vulkan_core.h
on their include path somewhere.

Bug: skia:
Change-Id: I969db396c92127be7c8df754926d175f38b8aafa
Reviewed-on: https://skia-review.googlesource.com/c/172147
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-11-26 15:15:44 +00:00
Mike Klein
e5b08df792 move NEON matrixProcs into matrixProcs.cpp
This is basically a no-op, just me doing a little bookkeeping to get
src/opts fully cleaned up.  As usual, I want to do more refactoring
after moving this around, as another CL probably.

Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Change-Id: I789611f90b8a86c88e34e95024109a7599463406
Reviewed-on: https://skia-review.googlesource.com/c/172421
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-11-21 16:32:37 +00:00
Mike Reed
45f8266e79 add flag to flutter
Bug: skia:
Change-Id: If55cd90b7ddd176348ceee178ffbc369a14a631e
Reviewed-on: https://skia-review.googlesource.com/c/172401
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2018-11-21 15:49:24 +00:00
Mike Klein
20e2fb2f92 SkBitmapProcState_matrixProcs.cpp refactoring
- Fold in _matrix_template.h
 - Make the NEON/non-NEON distictions a bit more clear.
 - Re-roll routines to their natural stride,
   leaving unrolling to the compiler.
 - Small style changes.
 - Leave some TODOs for another round.

Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Change-Id: Ide4111931aa5f19e23cac77722337ea5d53f72db
Reviewed-on: https://skia-review.googlesource.com/c/172020
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-11-20 15:55:23 +00:00
Chris Dalton
133944a14f Add a dedicated Op for analytic round rects
Adds a GrAAFillRRectOp class that can draw any round rect, including
complex. The Op makes use of instanced rendering and fwidth().

Bug: chromium:860021
Change-Id: I3d8818a003899b56c33d35babe22cd15d3f8e110
Reviewed-on: https://skia-review.googlesource.com/c/170729
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-11-19 19:26:12 +00:00
Leon Scroggins III
c41a5f58b2 Generate Android Framework host-side Skia (linux)
Bug: b/118742766

Update gn_to_bp to write an Android.bp file that will build a host-side
Skia library.

Switch some methods from SK_BUILD_FOR_ANDROID to
SK_BUILD_FOR_ANDROID_FRAMEWORK.

Prior reviews were done at ag/5482397.

gn_to_bp.py:
- Run GN twice - once for android and once for linux
- Disable GPU (depends on a to-be-written host side GL target) and HEIF
  (which relies on Android hardware) on linux
  - TODO: Turn on GPU on linux
- Split sources into everywhere, android-only, and linux-only.
  It seems that Android.bp does not allow using the same cpp
  file in multiple targets.
  - note that we currently *only* divide out the sources. The cflags are
    the same (except for a couple manual ones) and include
    directories are mostly the same (again, except for manual ones).
    Android has a "gpu" include directory, which I don't expect to
    make a difference to the linux build, which isn't using GPU (yet).
- Use the same "custom empty" font manager on the host as on Android
- Write separate SkUserConfig files; one for android and one for linux.
  This allows libskia to force libraries that use it to use the right
  defines by setting export_include_dirs.
- Add extra checks to SkUserConfig.h to ensure we have only the
  appropriate SK_BUILD_FOR macro defined
- Add host_supported: true for libskia

gn_to_bp_utils.py:
- Switch SkUserConfig.h from include guards to pragma once so it is
  easier to append to the end. This matches how Android generally
  includes headers.

BUILD.gn:
- Add skia_use_fixed_gamma_text so host build can use the same SK_GAMMA
  defines as the device.

SkPreConfig.h:
- Stop making SK_BUILD_FOR_ANDROID_FRAMEWORK imply SK_BUILD_FOR_ANDROID.
  The host build needs the former defined but not the latter.

SkRegion.cpp/.h:
- Make toString() SK_BUILD_FOR_ANDROID_FRAMEWORK so it can be called on
  the host.

SkCamera.h/.cpp:
- Switch methods to SK_BUILD_FOR_ANDROID_FRAMEWORK so they can be called
  on the host.
- Make getCameraLocation*() const. They are logically const, and this
  allows removing a const_cast + TODO in hwui.

Change-Id: I771f825d06380e01c0488fd1c00df1d8a2454dc0
Reviewed-on: https://skia-review.googlesource.com/c/171231
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-11-19 17:51:32 +00:00
Mike Klein
f2a7a20b32 clean up SkBitmapProcState a bit
- remove dead code
  - fold some headers back into SkBitmapProcState.cpp
  - misc cleanup

Change-Id: I8706efec086ac9ab5795f59de4a60c8d1bb75a7b
Reviewed-on: https://skia-review.googlesource.com/c/171589
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-11-19 16:07:37 +00:00
Brian Salomon
908bb23983 When outsetting for rect blur fast path use abs of scale factors.
Fixes an issue where negative scales caused an inset rather than an outset.

Add GM.

Bug: chromium:899512
Change-Id: I9164c76da479af80d4f5389b057ec52a946726fb
Reviewed-on: https://skia-review.googlesource.com/c/171641
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-11-19 15:35:42 +00:00
Mike Klein
a2187bf762 port S32_alpha_D32_filter_DX to SkOpts
I'll follow up by moving all the other things that live
in src/opts today into SkBitmapProcState.cpp... they
only use SSE2 or NEON, and don't need runtime detection.

There's lots of refactoring to do here still, and I've
mostly resisted the urge until this code is all in one place.

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Idea34a03c46d79b0fd6fbef1a49aaf27961c8260
Reviewed-on: https://skia-review.googlesource.com/c/171582
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-11-16 20:33:03 +00:00
Brian Salomon
09181ef042 Fix dst copy bounds for aa draw contained within clip.
Bug: chromium:892988

Change-Id: I615b60facec5724fb3a7c22a2eb59f72790156a3
Reviewed-on: https://skia-review.googlesource.com/c/171001
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-11-16 19:24:04 +00:00
Mike Reed
9c14ea13c2 Revert "remove SK_SUPPORT_LEGACY_NESTED_HINTINGENUM from flutter"
This reverts commit 449cb53bd8.

Reason for revert: breaks fuchsia (needs to roll newer flutter)

Original change's description:
> remove SK_SUPPORT_LEGACY_NESTED_HINTINGENUM from flutter
> 
> Bug: skia:
> Change-Id: I52abdd614de5367906b934dd95faa13b1d4a8569
> Reviewed-on: https://skia-review.googlesource.com/c/171528
> Reviewed-by: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: Iabedd7ffdedb39de06ef8184ba5cab077051f9cf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/171537
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-11-16 19:08:08 +00:00
Mike Reed
449cb53bd8 remove SK_SUPPORT_LEGACY_NESTED_HINTINGENUM from flutter
Bug: skia:
Change-Id: I52abdd614de5367906b934dd95faa13b1d4a8569
Reviewed-on: https://skia-review.googlesource.com/c/171528
Reviewed-by: Mike Reed <reed@google.com>
2018-11-16 18:34:23 +00:00
Mike Reed
8012a2f9ff remove SK_SUPPORT_LEGACY_FONT_FLAGS from flutter
Bug: skia:
Change-Id: I79b85a6b57b2193a5a64798eae3dd44e711dcc12
Reviewed-on: https://skia-review.googlesource.com/c/171526
Reviewed-by: Mike Reed <reed@google.com>
2018-11-16 17:36:05 +00:00
Mike Reed
b3162efff0 add flag to guard font apis
Bug: skia:
Change-Id: I331060364e0de4b5333958dd791997b767ba0dd5
Reviewed-on: https://skia-review.googlesource.com/c/171320
Reviewed-by: Mike Reed <reed@google.com>
2018-11-15 19:54:36 +00:00
Hal Canary
42d6c59025 SkPDF: pull out SkPDFSubsetFont code to another file.
Change-Id: Ib7f6b5a4e713beb537d1e0a8f20c7a8c0e666267
Reviewed-on: https://skia-review.googlesource.com/c/171226
Auto-Submit: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-11-15 19:45:35 +00:00
Chris Dalton
09212197d7 sksl: Support fwidth()
Adds fwidth() to SkSL, and adds a gm that draws an AA squircle to test
it.

Bug: skia:
Change-Id: Ida306cc535a1d4b4568d0ad5cc9a5f235098f4e8
Reviewed-on: https://skia-review.googlesource.com/c/170726
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-11-13 20:52:47 +00:00
Brian Osman
6c24245912 Remove SK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS from Skia's Chromium GN
This was moved to Chrome so we can rebaseline and remove it entirely.
https://chromium-review.googlesource.com/c/chromium/src/+/1334091

See also: https://codereview.chromium.org/1130883003

Bug: skia:
Change-Id: Iaf5f6e0cf2c978bff60cffc562a97784e22b24c8
Reviewed-on: https://skia-review.googlesource.com/c/170723
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-11-13 20:44:01 +00:00
Leon Scroggins III
be85c19a74 Build custom empty SkFontMgr for Android Framework
Bug: b/118742766

The Android Framework does not need SkFontMgr_android*. Switch it to
using SkFontMgr_custom*. This will also be the SkFontMgr to use when
we're building Skia as a host-side library.

BUILD.gn:
- Rename fontmgr_fuchsia to fontmgr_custom_empty so it can be selected
  specifically by the Android Framework build. Default condition is
  unchanged, so fuchsia will still build it.
- Similarly, create a new argument for fontmgr_android and
  fontmgr_custom, so they can be omitted by the Android Framework build.
  Again, default condition is unchanged, so no other builds should be
  affected.

gn_to_bp.py:
- Set the new arguments to build the files we want.

Change-Id: Ic85db8acd64f625b00fe2c9bc451ae8814d97a59
Reviewed-on: https://skia-review.googlesource.com/c/170725
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-11-13 20:17:10 +00:00
Mike Klein
eb4d641d94 Revert "remove old name for SkCodec::kNoFrame"
This reverts commit 06a477c330.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> remove old name for SkCodec::kNoFrame
> 
> Cq-Include-Trybots: skia.primary:Build-Debian9-Clang-arm-Release-Flutter_Android
> Change-Id: I039aed7591aa7767046f28a48798b6fa2f7fd643
> Reviewed-on: https://skia-review.googlesource.com/c/169224
> Reviewed-by: Leon Scroggins <scroggo@google.com>

TBR=mtklein@google.com,scroggo@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I6c61ee27a4167127c74c14e0f9e05a4bbac931a8
Cq-Include-Trybots: skia.primary:Build-Debian9-Clang-arm-Release-Flutter_Android
Reviewed-on: https://skia-review.googlesource.com/c/170422
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-11-12 16:26:04 +00:00
Mike Reed
8f4a25e404 re-add guard to flutter for fuchsia build -- until newer flutter lands
Bug: skia:
Change-Id: I408bc113f5036710c743890de45e286021c6be88
Reviewed-on: https://skia-review.googlesource.com/c/170346
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2018-11-12 14:45:59 +00:00
Mike Reed
025f783be8 add guard for fuchsia build
Bug: skia:
Change-Id: I3d4ae7c3dbae63001b2fab02d0f153390973f211
Reviewed-on: https://skia-review.googlesource.com/c/170345
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-11-12 14:32:29 +00:00
Mike Klein
024072af62 Reland "Improve degenerate 2pt conical gradient cases"
This reverts commit 95af4726bf.

Reason for revert: I think this may not have been the reason the Android roll was failing.  We've rolled, so it's a good time to try again.

Original change's description:
> Revert "Improve degenerate 2pt conical gradient cases"
> 
> This reverts commit 879dab87ab.
> 
> Reason for revert: Android roll failed.
> https://sponge.corp.google.com/target?id=93bc6b8d-9b42-4805-b204-46ae62f1b005&target=x86+CtsGraphicsTestCases&searchFor=&show=FAILED&sortBy=STATUS
> A test VectorDrawableTest.testVectorDrawableGradient fails.
> 
> Original change's description:
> > Improve degenerate 2pt conical gradient cases
> > 
> > This was originally a reland of "Fix div-by-zero loophole in gradient factory func", c34dd6c526, but:
> > 
> > The change caused blink layout tests when encountering very small or zero radii. The original patch switched the order of checking if the radii are equal and if the start radius was 0. In the case where both radii are 0, the original code created an actual radial gradient of radius 0 and the new code rejected the shader. A radial gradient with radius of 0 properly renders the last border color as a fill.
> > 
> > This made me realize that the case when the center positions and the radii are the same can be handled more correctly than just always returning an empty shader, so the fix now applies simplifications to the gradient definition depending on the tile mode and should not trigger any blink tests. I added a row to the gradient edge cases GM to make sure it degrades gracefully.
> > 
> > Original change's description:
> > > Fix div-by-zero loophole in gradient factory func
> > >
> > > Bug: oss-fuzz:10373
> > > Change-Id: I4277fb63e3186ee34feaf09ecf6aeddeb532f9c1
> > > Reviewed-on: https://skia-review.googlesource.com/c/168269
> > > Reviewed-by: Kevin Lubick <kjlubick@google.com>
> > > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > 
> > Docs-Preview: https://skia.org/?cl=168487
> > Bug: oss-fuzz:10373
> > Change-Id: Ib0a6e7f807560a5dcf24d1c8e0146817af2d9606
> > Reviewed-on: https://skia-review.googlesource.com/c/168487
> > Reviewed-by: Mike Reed <reed@google.com>
> > Reviewed-by: Florin Malita <fmalita@chromium.org>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> 
> TBR=caryclark@google.com,fmalita@chromium.org,fmalita@google.com,reed@google.com,michaelludwig@google.com
> 
> Change-Id: I91b896c4a438c02206679b327a01b47f40993965
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: oss-fuzz:10373
> Reviewed-on: https://skia-review.googlesource.com/c/170272
> Reviewed-by: Stan Iliev <stani@google.com>
> Commit-Queue: Stan Iliev <stani@google.com>

TBR=caryclark@google.com,fmalita@chromium.org,fmalita@google.com,reed@google.com,stani@google.com,michaelludwig@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: oss-fuzz:10373
Change-Id: I7577fcea9eb8a875e94723ab2cca2fcc990b82b2
Reviewed-on: https://skia-review.googlesource.com/c/170279
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-11-11 00:28:01 +00:00
Stan Iliev
95af4726bf Revert "Improve degenerate 2pt conical gradient cases"
This reverts commit 879dab87ab.

Reason for revert: Android roll failed.
https://sponge.corp.google.com/target?id=93bc6b8d-9b42-4805-b204-46ae62f1b005&target=x86+CtsGraphicsTestCases&searchFor=&show=FAILED&sortBy=STATUS
A test VectorDrawableTest.testVectorDrawableGradient fails.

Original change's description:
> Improve degenerate 2pt conical gradient cases
> 
> This was originally a reland of "Fix div-by-zero loophole in gradient factory func", c34dd6c526, but:
> 
> The change caused blink layout tests when encountering very small or zero radii. The original patch switched the order of checking if the radii are equal and if the start radius was 0. In the case where both radii are 0, the original code created an actual radial gradient of radius 0 and the new code rejected the shader. A radial gradient with radius of 0 properly renders the last border color as a fill.
> 
> This made me realize that the case when the center positions and the radii are the same can be handled more correctly than just always returning an empty shader, so the fix now applies simplifications to the gradient definition depending on the tile mode and should not trigger any blink tests. I added a row to the gradient edge cases GM to make sure it degrades gracefully.
> 
> Original change's description:
> > Fix div-by-zero loophole in gradient factory func
> >
> > Bug: oss-fuzz:10373
> > Change-Id: I4277fb63e3186ee34feaf09ecf6aeddeb532f9c1
> > Reviewed-on: https://skia-review.googlesource.com/c/168269
> > Reviewed-by: Kevin Lubick <kjlubick@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> 
> Docs-Preview: https://skia.org/?cl=168487
> Bug: oss-fuzz:10373
> Change-Id: Ib0a6e7f807560a5dcf24d1c8e0146817af2d9606
> Reviewed-on: https://skia-review.googlesource.com/c/168487
> Reviewed-by: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

TBR=caryclark@google.com,fmalita@chromium.org,fmalita@google.com,reed@google.com,michaelludwig@google.com

Change-Id: I91b896c4a438c02206679b327a01b47f40993965
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: oss-fuzz:10373
Reviewed-on: https://skia-review.googlesource.com/c/170272
Reviewed-by: Stan Iliev <stani@google.com>
Commit-Queue: Stan Iliev <stani@google.com>
2018-11-09 23:05:44 +00:00
Mike Klein
6a2c42f893 clean up SkBlitRow_opts
SSE2 and NEON are common baseline instruction sets now,
so there's no need to runtime detect support for these routines.

I simplified the SSE and portable implementations while moving them.

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I34e96851735c8d7ad90198f3ac4bf86ff508f17c
Reviewed-on: https://skia-review.googlesource.com/c/170220
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-11-09 17:58:05 +00:00
Mike Klein
32828eb006 move LCD blits to SkBlitter_ARGB32.cpp
They're only specialized up to SSE2 or NEON,
both of which are typical baseline builds now.

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: If2b2bbd5b002038c68c0064ee78d75911a33b988
Reviewed-on: https://skia-review.googlesource.com/c/170064
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-11-09 17:03:06 +00:00
Michael Ludwig
879dab87ab Improve degenerate 2pt conical gradient cases
This was originally a reland of "Fix div-by-zero loophole in gradient factory func", c34dd6c526, but:

The change caused blink layout tests when encountering very small or zero radii. The original patch switched the order of checking if the radii are equal and if the start radius was 0. In the case where both radii are 0, the original code created an actual radial gradient of radius 0 and the new code rejected the shader. A radial gradient with radius of 0 properly renders the last border color as a fill.

This made me realize that the case when the center positions and the radii are the same can be handled more correctly than just always returning an empty shader, so the fix now applies simplifications to the gradient definition depending on the tile mode and should not trigger any blink tests. I added a row to the gradient edge cases GM to make sure it degrades gracefully.

Original change's description:
> Fix div-by-zero loophole in gradient factory func
>
> Bug: oss-fuzz:10373
> Change-Id: I4277fb63e3186ee34feaf09ecf6aeddeb532f9c1
> Reviewed-on: https://skia-review.googlesource.com/c/168269
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

Docs-Preview: https://skia.org/?cl=168487
Bug: oss-fuzz:10373
Change-Id: Ib0a6e7f807560a5dcf24d1c8e0146817af2d9606
Reviewed-on: https://skia-review.googlesource.com/c/168487
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2018-11-09 16:36:05 +00:00
Mike Klein
ef4709b785 move blend-row routines to SkBlitter_ARGB32.cpp
SkBlend::RowFactory is only ever used to pass these function
pointers from SkBlitMask_D32.cpp to SkBlitMask_ARGB32.cpp,
so let's eliminate the middleman.

Change-Id: If74af775bb3cdc3eec9dc4ebeb180ac42b184a54
Reviewed-on: https://skia-review.googlesource.com/c/170062
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-11-09 15:41:21 +00:00
Mike Reed
c556c16fd3 remove obsolete guards for hinting enum
Bug: skia:
Change-Id: I694c9b4637d3979e7a11e1ff2c4b51acef59d405
Reviewed-on: https://skia-review.googlesource.com/c/169831
Reviewed-by: Mike Reed <reed@google.com>
2018-11-08 21:57:44 +00:00
Mike Klein
06a477c330 remove old name for SkCodec::kNoFrame
Cq-Include-Trybots: skia.primary:Build-Debian9-Clang-arm-Release-Flutter_Android
Change-Id: I039aed7591aa7767046f28a48798b6fa2f7fd643
Reviewed-on: https://skia-review.googlesource.com/c/169224
Reviewed-by: Leon Scroggins <scroggo@google.com>
2018-11-08 17:04:58 +00:00
Mike Reed
9edbf42e75 Revert[4] "hide nested hinting enum"
This reverts commit 8e12cc6dfe.

Bug: skia:
Change-Id: Ice5e3480adad75ab77d97f7366495015f36b15a6
Reviewed-on: https://skia-review.googlesource.com/c/169520
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-11-08 16:33:04 +00:00