Commit Graph

4541 Commits

Author SHA1 Message Date
bungeman
788840168f Provide tag-along for SkCreateTypefaceFromCTFont.
This provides a means of keeping an object alive for the entire
lifetime of an SkTypeface.

Review URL: https://codereview.chromium.org/1163573007
2015-06-08 13:39:13 -07:00
cdalton
edbb31f7dd Apply coverage in XP base class when using dst reads
Moves the coverage logic into GrGLXferProcessor for XPs that perform
dst reads. XPs that don't use a dst read are still responsible to
handle coverage on their own.

BUG=skia:

Review URL: https://codereview.chromium.org/1170553002
2015-06-08 12:14:44 -07:00
reed
c31af44336 change SkDraw and all Blitters to use pixmap instead of bitmap
BUG=skia:

Review URL: https://codereview.chromium.org/1148793007
2015-06-08 10:47:13 -07:00
reed
7aefe03211 Revert "Revert of move erase into SkPixmap (patchset #1 id:1 of https://codereview.chromium.org/1161033005/)"
This reverts commit cca9b3ac90.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1153473012
2015-06-08 10:22:22 -07:00
djsollen
cca9b3ac90 Revert of move erase into SkPixmap (patchset #1 id:1 of https://codereview.chromium.org/1161033005/)
Reason for revert:
broken builds

Original issue's description:
> move erase into SkPixmap
>
> harvested from https://codereview.chromium.org/1148793007
>
> BUG=skia:
> TBR=
>
> Committed: https://skia.googlesource.com/skia/+/0963f5dab079627c5523ce6a443af27a33e361f7

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

Review URL: https://codereview.chromium.org/1157303008
2015-06-08 10:03:49 -07:00
reed
0963f5dab0 move erase into SkPixmap
harvested from https://codereview.chromium.org/1148793007

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1161033005
2015-06-08 09:16:54 -07:00
robertphillips
63195181d1 Add bigtileimagefilter GM & improvements to toString
This is all the ancillary code from https://codereview.chromium.org/1152553006/ (Fix dst bound reported by SkTileImageFilter).

TBR=reed@google.com, senorblanco@google.com

Review URL: https://codereview.chromium.org/1169713003
2015-06-08 06:21:14 -07:00
reed
183b57f309 add extractSubset and SkAutoPixmapStorage
extracted from larger CL in progress: https://codereview.chromium.org/1148793007

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1162013008
2015-06-05 14:33:17 -07:00
reed
6e764859da clarify that accessPixels is for write-access, and peekPixels is RO
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1162203005
2015-06-05 14:11:32 -07:00
reed
56263c78d8 delete (unused) TransparentShader
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1153193014
2015-06-05 11:31:26 -07:00
reed
cb67414454 use pixmaps for dst in sprites -- NO BITMAPS
BUG=skia:
TBR=scroggo@google.com

Review URL: https://codereview.chromium.org/1143173011
2015-06-05 06:58:22 -07:00
jschuh
699b852e48 Remove unused PackBits methods and fix length checks
Also a bit of general cleanup.

BUG=chromium:486944

Review URL: https://codereview.chromium.org/1152163004
2015-06-04 15:10:37 -07:00
reed
ad7ae6c821 switch bitmapshader internals over to pixmap
BUG=skia:
NOTRY=True

Review URL: https://codereview.chromium.org/1158273007
2015-06-04 14:12:25 -07:00
robertphillips
270fe6aad5 Revert of Fix dst bound reported by SkTileImageFilter (patchset #3 id:40001 of https://codereview.chromium.org/1152553006/)
Reason for revert:
Blink

Original issue's description:
> Fix dst bound reported by SkTileImageFilter
>
> In the example from the bug we had the filter DAG:
>
> color filter (table)
>     0: xfermode filter (arith)
>         0: tile filter [0,80,34,114] -> [0,80,800,480]
>              0: color filter (table)
>                  0: bitmap src 34x34 -> [0,80,34,114]
>         1: color filter (table)
>              0: picture filter [0, 80, 800, 480]
>
> computeFastBounds was coming out of the DAG with a bound of [0,80,34,114] which didn't represent the pixels that would be drawn.
>
> This CL updates SkTileImageFilter to correctly set the bound for the pixels it will hit.
>
> BUG=493783
>
> Committed: https://skia.googlesource.com/skia/+/05be93bbdf09576f7903130e3b106b0a8c7c4b4e
>
> Committed: https://skia.googlesource.com/skia/+/0be685755f942baea26c66a87226b569fc17e960

TBR=reed@google.com,senorblanco@google.com,senorblanco@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=493783

Review URL: https://codereview.chromium.org/1156583004
2015-06-04 11:15:27 -07:00
robertphillips
0be685755f Fix dst bound reported by SkTileImageFilter
In the example from the bug we had the filter DAG:

color filter (table)
    0: xfermode filter (arith)
        0: tile filter [0,80,34,114] -> [0,80,800,480]
             0: color filter (table)
                 0: bitmap src 34x34 -> [0,80,34,114]
        1: color filter (table)
             0: picture filter [0, 80, 800, 480]

computeFastBounds was coming out of the DAG with a bound of [0,80,34,114] which didn't represent the pixels that would be drawn.

This CL updates SkTileImageFilter to correctly set the bound for the pixels it will hit.

BUG=493783

Committed: https://skia.googlesource.com/skia/+/05be93bbdf09576f7903130e3b106b0a8c7c4b4e

Review URL: https://codereview.chromium.org/1152553006
2015-06-04 06:53:37 -07:00
reed
64045423dd refactor bitmapshader to use a controller
BUG=skia:

Review URL: https://codereview.chromium.org/1153123003
2015-06-04 06:31:31 -07:00
junov
d26c9fa66c Fixing leaky handling of SkImage in SkDeferredCanvas.
Long lived SkImageHeap objects currently accumulate refs indefinitely.
This leads to massive memory leaks in the gpu-accelerated 2D canvas
code path. This CL does not implement a general fix for SkGPipe, but
it resolves the leak in SkDeferredCanvas (currently the only user
of SkGPipe) by resetting the image heap when the deferral queue is
flushed. This change also fixes the accounting of bytes allocated
by referenced images in order to trigger flushing heuristics
appropriately.

BUG=crbug.com/494148

Review URL: https://codereview.chromium.org/1145893007
2015-06-02 11:47:45 -07:00
robertphillips
a66cc7e1e0 Revert of Fix dst bound reported by SkTileImageFilter (patchset #3 id:40001 of https://codereview.chromium.org/1152553006/)
Reason for revert:
breaking tests

Original issue's description:
> Fix dst bound reported by SkTileImageFilter
>
> In the example from the bug we had the filter DAG:
>
> color filter (table)
>     0: xfermode filter (arith)
>         0: tile filter [0,80,34,114] -> [0,80,800,480]
>              0: color filter (table)
>                  0: bitmap src 34x34 -> [0,80,34,114]
>         1: color filter (table)
>              0: picture filter [0, 80, 800, 480]
>
> computeFastBounds was coming out of the DAG with a bound of [0,80,34,114] which didn't represent the pixels that would be drawn.
>
> This CL updates SkTileImageFilter to correctly set the bound for the pixels it will hit.
>
> BUG=493783
>
> Committed: https://skia.googlesource.com/skia/+/05be93bbdf09576f7903130e3b106b0a8c7c4b4e

TBR=reed@google.com,senorblanco@google.com,senorblanco@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=493783

Review URL: https://codereview.chromium.org/1143083006
2015-06-02 10:57:26 -07:00
robertphillips
05be93bbdf Fix dst bound reported by SkTileImageFilter
In the example from the bug we had the filter DAG:

color filter (table)
    0: xfermode filter (arith)
        0: tile filter [0,80,34,114] -> [0,80,800,480]
             0: color filter (table)
                 0: bitmap src 34x34 -> [0,80,34,114]
        1: color filter (table)
             0: picture filter [0, 80, 800, 480]

computeFastBounds was coming out of the DAG with a bound of [0,80,34,114] which didn't represent the pixels that would be drawn.

This CL updates SkTileImageFilter to correctly set the bound for the pixels it will hit.

BUG=493783

Review URL: https://codereview.chromium.org/1152553006
2015-06-02 10:52:43 -07:00
cdalton
1fa4572d1a Update XPF invariant info to not account for conflation
Renames getInvariantOutput to getInvariantBlendedColor on GrXPFactory
and redefines it to not account for coverage conflation. This is the
information that all the callsites actually wanted to know.

BUG=skia:

Review URL: https://codereview.chromium.org/1161273005
2015-06-02 10:43:39 -07:00
joshualitt
e5b74c6856 Set GeometryBufferMapThreshold defaults
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1161543003
2015-06-01 14:17:47 -07:00
joshualitt
7fe8ee4cb7 Expand VisualBench to a real benching tool
BUG=skia:

Review URL: https://codereview.chromium.org/1159213002
2015-06-01 10:03:55 -07:00
bsalomon
c59a1df655 Stretch small textures up to 16 pixels on PowerVR 54x
Review URL: https://codereview.chromium.org/1161183002
2015-06-01 07:13:42 -07:00
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