Commit Graph

4518 Commits

Author SHA1 Message Date
reed
db74f62c7a Revert[6] of add asserts around results from requestLock
This reverts commit 11e833d91b.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1159183003
2015-05-30 13:41:15 -07:00
reed
11e833d91b Revert of Revert[4] of add asserts around results from requestLock (patchset #3 id:40001 of https://codereview.chromium.org/1159733006/)
Reason for revert:
gfx_unittests (under linux_asan)

@@@STEP_LOG_LINE@RenderTextTest.HarfBuzz_HorizontalPositions@Direct leak of 368 byte(s) in 1 object(s) allocated from:@@@
@@@STEP_LOG_LINE@RenderTextTest.HarfBuzz_HorizontalPositions@    #0 0x4cc74b in __interceptor_malloc (/b/build/slave/linux_asan/build/src/out/Release/gfx_unittests+0x4cc74b)@@@
@@@STEP_LOG_LINE@RenderTextTest.HarfBuzz_HorizontalPositions@    #1 0x7f2f7060ebdf in _cairo_image_surface_create_for_pixman_image /build/buildd/cairo-1.10.2/src/cairo-image-surface.c:158@@@
@@@STEP_LOG_LINE@RenderTextTest.HarfBuzz_HorizontalPositions@@@@
@@@STEP_LOG_LINE@RenderTextTest.HarfBuzz_HorizontalPositions@Indirect leak of 256 byte(s) in 1 object(s) allocated from:@@@
@@@STEP_LOG_LINE@RenderTextTest.HarfBuzz_HorizontalPositions@    #0 0x4cc74b in __interceptor_malloc (/b/build/slave/linux_asan/build/src/out/Release/gfx_unittests+0x4cc74b)@@@
@@@STEP_LOG_LINE@RenderTextTest.HarfBuzz_HorizontalPositions@    #1 0x7f2f6c7be26a in _pixman_image_allocate /build/buildd/pixman-0.30.2/build/pixman/../../pixman/pixman-image.c:184@@@
@@@STEP_LOG_LINE@RenderTextTest.HarfBuzz_HorizontalPositions@@@@

I think they are creating a cairo surface, but it has no pixels (zero size?). In this CL, if I see no pixels, I ignore the call-back which is used to free the surface (doh).

Original issue's description:
> Revert[4] of add asserts around results from requestLock
>
> This reverts commit 19663e54c0.
>
> BUG=skia:
> TBR=
>
> Committed: https://skia.googlesource.com/skia/+/df91b73a34e3a306c93a5e320704736255c3d9f0

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

Review URL: https://codereview.chromium.org/1151063005
2015-05-30 09:20:29 -07:00
reed
df91b73a34 Revert[4] of add asserts around results from requestLock
This reverts commit 19663e54c0.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1159733006
2015-05-30 06:32:55 -07:00
reed
19663e54c0 Revert of add asserts around results from requestLock (patchset #3 id:40001 of https://codereview.chromium.or… (patchset #1 id:1 of https://codereview.chromium.org/1165583005/)
Reason for revert:
failure in cc_unittests (need to diagnose)

@@@STEP_LOG_LINE@ResourceProviderTests_ResourceProviderTest.TransferInvalidSoftware_1@ResourceProviderTests/ResourceProviderTest.TransferInvalidSoftware/1 (run #1):@@@
@@@STEP_LOG_LINE@ResourceProviderTests_ResourceProviderTest.TransferInvalidSoftware_1@[ RUN      ] ResourceProviderTests/ResourceProviderTest.TransferInvalidSoftware/1@@@
@@@STEP_LOG_LINE@ResourceProviderTests_ResourceProviderTest.TransferInvalidSoftware_1@[17114:17114:0529/180822:15336467671:INFO:SkPixelRef.cpp(168)] ../../third_party/skia/src/core/SkPixelRef.cpp:168: failed assertion "pixels"@@@

Original issue's description:
> add asserts around results from requestLock (patchset #3 id:40001 of https://codereview.chromium.org/1155403003/)"
>
> This reverts commit 3953d36041.
>
> BUG=skia:
> TBR=
>
> Committed: https://skia.googlesource.com/skia/+/6980f5a96455c8062403c995a64b654a0e9a1319

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

Review URL: https://codereview.chromium.org/1151573009
2015-05-29 18:36:07 -07:00
reed
6980f5a964 add asserts around results from requestLock (patchset #3 id:40001 of https://codereview.chromium.org/1155403003/)"
This reverts commit 3953d36041.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1165583005
2015-05-29 15:46:36 -07:00
reed
3953d36041 Revert of add asserts around results from requestLock (patchset #3 id:40001 of https://codereview.chromium.org/1155403003/)
Reason for revert:
asserts in ui/gfx unittests (need to investigate why)

[ RUN      ] RenderTextTest.SelectionKeepsLigatures
[14602:14602:0529/134016:16779526944:INFO:SkPixelRef.cpp(164)] ../../third_party/skia/src/core/SkPixelRef.cpp:164: failed assertion "pixels"

Original issue's description:
> add asserts around results from requestLock and lockPixels, ensuring that true always means we have non-null pixels (and non-null colortable if that matches the colortype)
>
> BUG= 491975
> TBR=
>
> Committed: https://skia.googlesource.com/skia/+/f941a68126d8fe647eaea902c244c466568b7809

TBR=scroggo@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG= 491975

Review URL: https://codereview.chromium.org/1159013006
2015-05-29 14:22:05 -07:00
reed
f941a68126 add asserts around results from requestLock and lockPixels, ensuring that true always means we have non-null pixels (and non-null colortable if that matches the colortype)
BUG= 491975
TBR=

Review URL: https://codereview.chromium.org/1155403003
2015-05-29 11:39:14 -07:00
bsalomon
993a4216a6 SkImage::NewFromYUVTexturesCopy
Review URL: https://codereview.chromium.org/1149553002
2015-05-29 11:37:25 -07:00
joshualitt
29f8679068 Removing GrAutoMalloc
BUG=skia:

Review URL: https://codereview.chromium.org/1161993003
2015-05-29 08:06:48 -07:00
bsalomon
7622863095 Add direct getter for GrCaps to GrContext.
TBR=joshualitt@google.com

Committed: https://skia.googlesource.com/skia/+/9138c46e572085870638b6f7ad7fcdfcdf3cac99

Review URL: https://codereview.chromium.org/1149773005
2015-05-29 08:02:10 -07:00
joshualitt
611cc5f964 delete experimental path renderers
BUG=skia:

Review URL: https://codereview.chromium.org/1160863006
2015-05-29 07:09:09 -07:00
joshualitt
7224c86632 add context override of GeometryBufferMapThreshold
BUG=skia:

Review URL: https://codereview.chromium.org/1159713006
2015-05-29 06:46:47 -07:00
joshualitt
bd245426bb Revert of small CL to experiment with 'disabling' memory mapping (patchset #1 id:1 of https://codereview.chromium.org/1160003004/)
Reason for revert:
experiment complete

Original issue's description:
> small CL to experiment with 'disabling' memory mapping
>
> TBR=bsalomon@google.com
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/2e48e1514396b363ecd19372eab637b11bfb8a82

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

Review URL: https://codereview.chromium.org/1159133004
2015-05-28 13:40:20 -07:00
joshualitt
2e48e15143 small CL to experiment with 'disabling' memory mapping
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1160003004
2015-05-28 11:53:49 -07:00
bsalomon
084d1b61bc Revert of Add direct getter for GrCaps to GrContext. (patchset #4 id:60001 of https://codereview.chromium.org/1149773005/)
Reason for revert:
Breaking

Original issue's description:
> Add direct getter for GrCaps to GrContext.
>
> TBR=joshualitt@google.com
>
> Committed: https://skia.googlesource.com/skia/+/9138c46e572085870638b6f7ad7fcdfcdf3cac99

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

Review URL: https://codereview.chromium.org/1164443002
2015-05-28 08:20:58 -07:00
bsalomon
9138c46e57 Add direct getter for GrCaps to GrContext.
TBR=joshualitt@google.com

Review URL: https://codereview.chromium.org/1149773005
2015-05-28 08:13:16 -07:00
reed
6e43465039 simplify RawIter - don't return a pt in kClose
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1156893003
2015-05-27 19:53:25 -07:00
cdalton
6fd158ea47 Implement Porter Duff XP with a blend table
Removes the runtime logic used by PorterDuffXferProcessor to decide
blend coeffs and shader outputs, and instead uses a compile-time
constant table of pre-selected blend formulas. Separates out the dst
read fallback into its own XP.

Introduces a new blend strategy for srcCoeff=0 that can apply coverage
with a reverse subtract blend equation instead of dual source
blending.

Adds new macros in GrBlend.h to analyze blend formulas both runtime.

Removes kSetCoverageDrawing_OptFlag and GrSimplifyBlend as they are no
longer used.

Adds a GM that verifies all xfermodes, including arithmetic, with the
color/coverage invariants used by Porter Duff.

Adds a unit test that verifies each Porter Duff formula with every
color/coverage invariant.

Major changes:

 * Uses a reverse subtract blend equation for coverage when srcCoeff=0
   (clear, dst-out [Sa=1], dst-in, modulate). Platforms that don't
   support dual source blending no longer require a dst copy for
   dst-in and modulate.

 * Sets BlendInfo::fWriteColor to false when the blend does not modify
   the dst. GrGLGpu will now use glColorMask instead of blending for
   these modes (dst, dst-in [Sa=1], modulate ignored for [Sc=1]).

 * Converts all SA blend coeffs to One for opaque inputs, and ISA to
   Zero if there is also no coverage. (We keep ISA around when there
   is coverage because we use it to tweak alpha for coverage.)

 * Abandons solid white optimizations for the sake of simplicity
   (screen was the only mode that previous had solid white opts).

Minor differences:

 * Inconsequential differences in opt flags (e.g. we now return
   kCanTweakAlphaForCoverage_OptFlag even when there is no coverage).

 * Src coeffs when the shader outputs 0.

 * IS2C vs IS2A when the secondary output is scalar.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/9a70920db22b6309c671f8e5d519bb95570e4414

Review URL: https://codereview.chromium.org/1124373002
2015-05-27 15:08:33 -07:00
bsalomon
4ee6bd86c5 Add caps overrides to GMs
Review URL: https://codereview.chromium.org/1158963002
2015-05-27 13:23:23 -07:00
robertphillips
ccb1b57510 Move SkGpuDevice::internalDrawPath to GrBlurUtils::drawPathWithMaskFilter
This CL is ugly but it:

removes the stored SkGpuDevice back pointer from GrTextContext (at the cost of passing more parameters)
moves SkGpuDevice::internalDrawPath to GrDrawContext::drawPathFull

Unfortunately, the GrTextContext-derived classes still need the SkGpuDevice for filterTextFlags calls but I will try removing that in a separate CL.

Review URL: https://codereview.chromium.org/1157773003
2015-05-27 11:02:55 -07:00
joshualitt
da7b843fbd CL to add setFullscreen and setVsync to SkWindow
BUG=skia:

Review URL: https://codereview.chromium.org/1151333004
2015-05-27 09:19:03 -07:00
robertphillips
4b195e5d8f Unblock DEPS roll by remove SkAutoTUnref from GrDrawContext
BUG=skia:

Review URL: https://codereview.chromium.org/1156103006
2015-05-26 14:37:00 -07:00
robertphillips
ea46150344 Split drawing functionality out of GrContext and into new GrDrawContext
This is mainly a mechanical CL. There were some fiddly bits in GrContext.cpp where it no longer had access to the GrDrawTarget (and had to use the new GrDrawContext).

I've converted GrAARectRenderer & GrOvalRenderer into static classes so I could stop allocating them.

Review URL: https://codereview.chromium.org/1151283004
2015-05-26 11:38:03 -07:00
reed
884e97cb04 change internals over to SkPixmap and stop using accessBitmap
BUG=skia:

Review URL: https://codereview.chromium.org/1155443004
2015-05-26 11:31:54 -07:00
bsalomon
6a44c6a7d8 Move DstCoordTexture to GrXP, rename and remove the word "copy" from dstcopytexture names.
Committed: https://skia.googlesource.com/skia/+/bb106b5f6ee18f7453b63f3a95f421b60a957f39

Review URL: https://codereview.chromium.org/1132093004
2015-05-26 09:49:05 -07:00
reed
cd1d41e7c1 remove unneeded device:lockpixels
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1156073003
2015-05-25 21:21:27 -07:00
reed
95d343f408 move readPixels from bitmap -> pixmap
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1153893003
2015-05-23 13:21:07 -07:00
bungeman
c33db93d1b Revert of Implement Porter Duff XP with a blend table (patchset #12 id:220001 of https://codereview.chromium.org/1124373002/)
Reason for revert:
Blocking DEPS roll into Chromium. Crashing virtual/gpu/fast/canvas/canvas-composite-*.html tests with the assert

../../third_party/skia/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp:281: failed assertion "k110_GrGLSLGeneration != gpu->glslGeneration() || fOutputs.empty()"

Original issue's description:
> Implement Porter Duff XP with a blend table
>
> Removes the runtime logic used by PorterDuffXferProcessor to decide
> blend coeffs and shader outputs, and instead uses a compile-time
> constant table of pre-selected blend formulas.
>
> Introduces a new blend strategy for srcCoeff=0 that can apply coverage
> with a reverse subtract blend equation instead of dual source
> blending.
>
> Adds new macros in GrBlend.h to analyze blend formulas both runtime.
>
> Removes kSetCoverageDrawing_OptFlag and GrSimplifyBlend as they are no
> longer used.
>
> Adds a GM that verifies all xfermodes, including arithmetic, with the
> color/coverage invariants used by Porter Duff.
>
> Adds a unit test that verifies each Porter Duff formula with every
> color/coverage invariant.
>
> Major changes:
>
>  * Uses a reverse subtract blend equation for coverage when srcCoeff=0
>    (clear, dst-out [Sa=1], dst-in, modulate). Platforms that don't
>    support dual source blending no longer require a dst copy for
>    dst-in and modulate.
>
>  * Sets BlendInfo::fWriteColor to false when the blend does not modify
>    the dst. GrGLGpu will now use glColorMask instead of blending for
>    these modes (dst, dst-in [Sa=1], modulate ignored for [Sc=1]).
>
>  * Converts all SA blend coeffs to One for opaque inputs, and ISA to
>    Zero if there is also no coverage. (We keep ISA around when there
>    is coverage because we use it to tweak alpha for coverage.)
>
>  * Abandons solid white optimizations for the sake of simplicity
>    (screen was the only mode that previous had solid white opts).
>
> Minor differences:
>
>  * Inconsequential differences in opt flags (e.g. we now return
>    kCanTweakAlphaForCoverage_OptFlag even when there is no coverage).
>
>  * Src coeffs when the shader outputs 0.
>
>  * IS2C vs IS2A when the secondary output is scalar.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/9a70920db22b6309c671f8e5d519bb95570e4414

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

Review URL: https://codereview.chromium.org/1153993002
2015-05-22 17:55:26 -07:00
bungeman
d23a395d51 Revert of Move DstCoordTexture to GrXP, rename and remove the word "copy" from dstcopytexture names. (patchset #6 id:100001 of https://codereview.chromium.org/1132093004/)
Reason for revert:
This is asserting on GTX660 bots with '!dst'. This may just be catching an existing issue.

https://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-ShuttleA-GPU-GTX660-x86_64-Debug/builds/622/steps/dm/logs/stdio

https://build.chromium.org/p/client.skia/builders/Test-Win7-MSVC-ShuttleA-GPU-HD2000-x86-Debug-ANGLE/builds/209/steps/dm/logs/stdio

https://build.chromium.org/p/client.skia/builders/Test-Win8-MSVC-ShuttleA-GPU-GTX660-x86_64-Debug/builds/318/steps/dm/logs/stdio

Original issue's description:
> Move DstCoordTexture to GrXP, rename and remove the word "copy" from dstcopytexture names.
>
> Committed: https://skia.googlesource.com/skia/+/bb106b5f6ee18f7453b63f3a95f421b60a957f39

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

Review URL: https://codereview.chromium.org/1158453004
2015-05-22 15:22:48 -07:00
bsalomon
bb106b5f6e Move DstCoordTexture to GrXP, rename and remove the word "copy" from dstcopytexture names.
Review URL: https://codereview.chromium.org/1132093004
2015-05-22 14:32:10 -07:00
bsalomon
682c269a15 Store context options on caps.
Committed: https://skia.googlesource.com/skia/+/f28cff71db2cbb1ff18a8fbf1e80ca761d1f69bc

Review URL: https://codereview.chromium.org/1158433006
2015-05-22 14:01:46 -07:00
bsalomon
08bf86d1b7 Revert of Store context options on caps. (patchset #3 id:40001 of https://codereview.chromium.org/1158433006/)
Reason for revert:
breaking chromeos build (???)

Original issue's description:
> Store context options on caps.
>
> Committed: https://skia.googlesource.com/skia/+/f28cff71db2cbb1ff18a8fbf1e80ca761d1f69bc

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

Review URL: https://codereview.chromium.org/1151603005
2015-05-22 12:41:05 -07:00
bsalomon
f28cff71db Store context options on caps.
Review URL: https://codereview.chromium.org/1158433006
2015-05-22 12:25:41 -07:00
cdalton
9a70920db2 Implement Porter Duff XP with a blend table
Removes the runtime logic used by PorterDuffXferProcessor to decide
blend coeffs and shader outputs, and instead uses a compile-time
constant table of pre-selected blend formulas.

Introduces a new blend strategy for srcCoeff=0 that can apply coverage
with a reverse subtract blend equation instead of dual source
blending.

Adds new macros in GrBlend.h to analyze blend formulas both runtime.

Removes kSetCoverageDrawing_OptFlag and GrSimplifyBlend as they are no
longer used.

Adds a GM that verifies all xfermodes, including arithmetic, with the
color/coverage invariants used by Porter Duff.

Adds a unit test that verifies each Porter Duff formula with every
color/coverage invariant.

Major changes:

 * Uses a reverse subtract blend equation for coverage when srcCoeff=0
   (clear, dst-out [Sa=1], dst-in, modulate). Platforms that don't
   support dual source blending no longer require a dst copy for
   dst-in and modulate.

 * Sets BlendInfo::fWriteColor to false when the blend does not modify
   the dst. GrGLGpu will now use glColorMask instead of blending for
   these modes (dst, dst-in [Sa=1], modulate ignored for [Sc=1]).

 * Converts all SA blend coeffs to One for opaque inputs, and ISA to
   Zero if there is also no coverage. (We keep ISA around when there
   is coverage because we use it to tweak alpha for coverage.)

 * Abandons solid white optimizations for the sake of simplicity
   (screen was the only mode that previous had solid white opts).

Minor differences:

 * Inconsequential differences in opt flags (e.g. we now return
   kCanTweakAlphaForCoverage_OptFlag even when there is no coverage).

 * Src coeffs when the shader outputs 0.

 * IS2C vs IS2A when the secondary output is scalar.

BUG=skia:

Review URL: https://codereview.chromium.org/1124373002
2015-05-22 11:36:57 -07:00
bsalomon
424cc26add Remove init from GrGLContextInfo and caps classes
Make Gr*Caps, GrGLContext* noncopyable

Review URL: https://codereview.chromium.org/1153813002
2015-05-22 10:37:30 -07:00
reed
92fc2ae583 add SkPixmap and external locking to bitmaps
BUG=skia:

Review URL: https://codereview.chromium.org/1074983003
2015-05-22 08:06:22 -07:00
bsalomon
eb1cb5c5b5 rename GrDrawTargetCaps.h to GrCaps.h and move to include
Review URL: https://codereview.chromium.org/1135113005
2015-05-22 08:01:09 -07:00
mtklein
051a51ec32 Re-proc SkBlitRow::Color32 for ARM.
This is a spiritual revert of http://crrev.com/1104183004.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/4e13a23d8f720e17660f26657b45b89fe4339004

Review URL: https://codereview.chromium.org/1145283003
2015-05-22 06:08:29 -07:00
mtklein
3b8d9f776e Revert of Re-proc SkBlitRow::Color32 for ARM. (patchset #3 id:40001 of https://codereview.chromium.org/1145283003/)
Reason for revert:
http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_rel_device_ninja/builds/70016/steps/compile%20%28with%20patch%29/logs/stdio

Original issue's description:
> Re-proc SkBlitRow::Color32 for ARM.
>
> This is a spiritual revert of http://crrev.com/1104183004.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/4e13a23d8f720e17660f26657b45b89fe4339004

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

Review URL: https://codereview.chromium.org/1157633003
2015-05-22 05:51:37 -07:00
mtklein
4e13a23d8f Re-proc SkBlitRow::Color32 for ARM.
This is a spiritual revert of http://crrev.com/1104183004.

BUG=skia:

Review URL: https://codereview.chromium.org/1145283003
2015-05-21 17:14:51 -07:00
reed
5a72c42952 remove unused SkBitmap::scrollRect API
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1154623002
2015-05-21 15:46:20 -07:00
cdalton
0edea2c8e7 Make mixed samples contingent on auxiliary extensions
Moves the cap for mixed samples into GrShaderCaps and does not enable
it unless we have support for both dual source blending and
multisample disable.

Creates a dedicated cap for multisample disable.

Reconfigures the mixed samples cap to indicate the collective
capability of three different extensions:

  GL_NV_framebuffer_mixed_samples
  GL_NV_sample_mask_override_coverage
  GL_EXT_raster_multisample

Imports tokens and procedures for GL_EXT_raster_multisample.

BUG=skia:

Review URL: https://codereview.chromium.org/1151793002
2015-05-21 08:27:44 -07:00
jvanverth
fb5df43af8 Add RGBA half float texture format.
BUG=skia:3829

Review URL: https://codereview.chromium.org/1148243002
2015-05-21 08:12:27 -07:00
reed
67ca2a93f9 purge imagefilter cache so we can better track leaks
BUG=skia:

Review URL: https://codereview.chromium.org/1148973002
2015-05-20 13:22:58 -07:00
mtklein
76be9c8dc0 Don't serialize SkPictures in SkPictureShaders when in untrusted mode.
This requires we "first" add a has-picture bool to SkPictureShader serialized format.

BUG=chromium:486947, billions and billions of others.

Review URL: https://codereview.chromium.org/1151663002
2015-05-20 12:05:15 -07:00
mtklein
fd6a07b1e8 Have SkPicture inherit from SkRefCnt.
This re-enables adoption tracking for SkPictures in Blink,
which should be green now that crrev.com/1136123011 has landed.

BUG=skia:3847

Review URL: https://codereview.chromium.org/1145153002
2015-05-20 10:55:49 -07:00
bungeman
41868fe562 Font variations.
Multiple Master and TrueType fonts support variation axes.
This implements back-end support for axes on platforms which
support it.

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

Committed: https://skia.googlesource.com/skia/+/3489ee0f4fa34f124f9de090d12bdc2107d52aa9

Review URL: https://codereview.chromium.org/1027373002
2015-05-20 09:21:04 -07:00
mtklein
9db912c2ac Sketch splitting SkPicture into an interface and SkBigPicture.
Adds small pictures for drawRect(), drawTextBlob(), and drawPath().
These cover about 89% of draw calls from Blink SKPs,
and about 25% of draw calls from our GMs.

SkPicture handles:
  - serialization and deserialization
  - unique IDs

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

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

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

BUG=skia:

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

Latest blink_linux_rel:

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

Committed: https://skia.googlesource.com/skia/+/15877b6eae33a9282458bdb904a6d00440eca0ec

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

Review URL: https://codereview.chromium.org/1112523006
2015-05-19 11:11:26 -07:00
bsalomon
4b91f768b3 rename GrDrawTargetCaps to GrCaps
Review URL: https://codereview.chromium.org/1133123009
2015-05-19 09:29:46 -07:00
kkinnunen
54b8511189 Make GrResourceCache perf less sensitive to key length change
Make GrResourceCache performance less sensitive to key length change.
The memcmp in GrResourceKey is called when SkTDynamicHash jumps the
slots to find the hash by a index. Avoid most of the memcmps by
comparing the hash first.

This is important because small changes in key data length can cause
big performance regressions. The theory is that key length change causes
different hash values. These hash values might trigger memcmps that
originally weren't there, causing the regression.

Adds few specialized benches to grresourcecache_add to test different
key lengths. The tests are run only on release, because on debug the
SkTDynamicHash validation takes too long, and adding many such delays
to development test runs would be unproductive. On release the tests
are quite fast.

Effect of this patch to the added tests on amd64:
grresourcecache_find_10  738us ->  768us        1.04x
 grresourcecache_find_2  472us ->  476us        1.01x
grresourcecache_find_25  841us ->  845us        1x
 grresourcecache_find_4  565us ->  531us        0.94x
grresourcecache_find_54 1.18ms ->  1.1ms        0.93x
 grresourcecache_find_5  834us ->  749us        0.9x
 grresourcecache_find_3  620us ->  542us        0.87x
 grresourcecache_add_25 2.74ms -> 2.24ms        0.82x
 grresourcecache_add_56 3.23ms -> 2.56ms        0.79x
 grresourcecache_add_54 3.34ms -> 2.62ms        0.78x
  grresourcecache_add_5 2.68ms ->  2.1ms        0.78x
 grresourcecache_add_10  2.7ms -> 2.11ms        0.78x
  grresourcecache_add_2 1.85ms -> 1.41ms        0.76x
    grresourcecache_add 1.84ms ->  1.4ms        0.76x
  grresourcecache_add_4 1.99ms -> 1.49ms        0.75x
  grresourcecache_add_3 2.11ms -> 1.55ms        0.73x
 grresourcecache_add_55   39ms -> 13.9ms        0.36x
grresourcecache_find_55 23.2ms -> 6.21ms        0.27x

On arm64 the results are similar.

On arm_v7_neon, the results lack the discontinuity at 55:
    grresourcecache_add 4.06ms -> 4.26ms        1.05x
  grresourcecache_add_2 4.05ms -> 4.23ms        1.05x
   grresourcecache_find 1.28ms ->  1.3ms        1.02x
grresourcecache_find_56 3.35ms -> 3.32ms        0.99x
 grresourcecache_find_2 1.31ms -> 1.29ms        0.99x
grresourcecache_find_54 3.28ms -> 3.24ms        0.99x
  grresourcecache_add_5 6.38ms -> 6.26ms        0.98x
 grresourcecache_add_55 8.44ms -> 8.24ms        0.98x
 grresourcecache_add_25 7.03ms -> 6.86ms        0.98x
grresourcecache_find_25  2.7ms -> 2.59ms        0.96x
 grresourcecache_find_4 1.45ms -> 1.38ms        0.95x
grresourcecache_find_10 2.52ms -> 2.39ms        0.95x
grresourcecache_find_55 3.54ms -> 3.33ms        0.94x
 grresourcecache_find_5  2.5ms -> 2.32ms        0.93x
 grresourcecache_find_3 1.57ms -> 1.43ms        0.91x

The extremely slow case, 55, is postulated to be due to the index jump
collisions running the memcmp. This is not visible on arm_v7_neon probably due
to hash function producing different results for 32 bit architectures.

This change is needed for extending path cache key in Gr
NV_path_rendering codepath. Extending is needed in order to add dashed
paths to the path cache.

Review URL: https://codereview.chromium.org/1132723003
2015-05-18 22:47:33 -07:00