Commit Graph

4637 Commits

Author SHA1 Message Date
reed
7ab04d949b remove dead guarded code for legacy SkData proc
BUG=skia:

Review URL: https://codereview.chromium.org/1173173007
2015-06-18 13:42:03 -07:00
reed
de49988bc2 add callbacks to Images that wrap client-provided content
BUG=skia:

Review URL: https://codereview.chromium.org/1169553003
2015-06-18 13:41:40 -07:00
bsalomon
241b56db1d Allows windowed apps to be built on the Mac just by writing a SkOSWindow subclass without needing nib/plist files.
Makes visualbench work on the Mac.

Review URL: https://codereview.chromium.org/1184143011
2015-06-18 11:49:42 -07:00
joshualitt
274980cda1 Revert of Work around for nexus 6 TexSubImage issue (patchset #4 id:60001 of https://codereview.chromium.org/1173203005/)
Reason for revert:
breaks gms

Original issue's description:
> Work around for nexus 6 TexSubImage issue
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/c69fe20ef35df0776b179cbd5ce4d1bdc0ba4090

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

Review URL: https://codereview.chromium.org/1190463006
2015-06-18 11:49:18 -07:00
joshualitt
c69fe20ef3 Work around for nexus 6 TexSubImage issue
BUG=skia:

Review URL: https://codereview.chromium.org/1173203005
2015-06-18 11:07:09 -07:00
bsalomon
6dc6f5f4a1 Add support for creating texture backed images where Skia will delete the texture.
Review URL: https://codereview.chromium.org/1187523005
2015-06-18 09:12:17 -07:00
bungeman
7b7c844bca Remove unused SkTypeface_android.h.
This file had one declaration in it which actually affected the
SkFontMgr and had nothing to do with typefaces specifically. As a
result, the declaration was moved to SkFontMgr_android.h. Now that
the users have been updated, remove this now unused file.

Review URL: https://codereview.chromium.org/1177173004
2015-06-18 07:46:58 -07:00
robertphillips
bcd7ab5c0d Add useDFT field to SkDeviceProperties
Review URL: https://codereview.chromium.org/1191943002
2015-06-18 05:27:18 -07:00
mtklein
00b621cfc0 Add sk_parallel_for()
This should be a drop-in replacement for most for-loops to make them run in parallel:
   for (int i = 0; i < N; i++) { code... }
   ~~~>
   sk_parallel_for(N, [&](int i) { code... });

This is just syntax sugar over SkTaskGroup to make this use case really easy to write.
There's no more overhead that we weren't already forced to add using an interface like batch(),
and no extra heap allocations.

I've replaced 3 uses of SkTaskGroup with sk_parallel_for:
  1) My unit tests for SkOnce.
  2) Cary's path fuzzer.
  3) SkMultiPictureDraw.
Performance should be the same.  Please compare left and right for readability. :)

BUG=skia:

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

Review URL: https://codereview.chromium.org/1184373003
2015-06-17 15:26:15 -07:00
bungeman
77f85adadb Move Android SkFontMgr::Factory to its own file.
Review URL: https://codereview.chromium.org/1190993002
2015-06-17 12:07:10 -07:00
reed
6b7f34e34c simplify release-proc for SkData, removing unneeded size param
request https://codereview.chromium.org/1184953005 to land first

BUG=skia:

Review URL: https://codereview.chromium.org/1193553002
2015-06-17 09:58:25 -07:00
bungeman
0b1de2626a Move FontConfig factory into separate file.
This moves the SkFontMgr::Factory implementation which creates a
FontMgr around FontConfig into its own file, and allows the user
to create one manually.

Review URL: https://codereview.chromium.org/1189753007
2015-06-17 07:56:00 -07:00
mtklein
942e99b9c4 Modernize atomics in SkTaskGroup's threadpool.
- Use SkAtomic<int32_t> for pending work count so we're statically
      forced to operate on it with atomic methods.
    - Replacing old methods like sk_atomic_inc/dec gives us finer control
      over which barriers we need for each operation.

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

BUG=skia:

Review URL: https://codereview.chromium.org/1193493003
2015-06-17 07:53:22 -07:00
robertphillips
2334fb655f Make GrTextContext be owned by the GrDrawContext
This CL makes the GrTextContext be owned (and hidden) by the GrDrawContext. This funnels all the drawText* calls through the GrDrawContext and hides the (dispreferred) GrPipelineBuilder drawText variant.

Some consequences of this are:

GrDrawContext now has to get the text drawing settings (i.e., SkDeviceProperties & useDFT). This means that we need a separate GrDrawContext for each combination of pixel geometry and DFT-use.

All the GrTextContext-derived classes now get a back pointer to the originating GrDrawContext so their method calls no longer take one.

Committed: https://skia.googlesource.com/skia/+/5b16e740fe6ab6d679083d06f07651602265081b

Review URL: https://codereview.chromium.org/1175553002
2015-06-17 05:43:33 -07:00
bsalomon
781d58215f Revert of Make GrTextContext be owned by the GrDrawContext (patchset #7 id:120001 of https://codereview.chromium.org/1175553002/)
Reason for revert:
Breaking Test-Win8-MSVC-ShuttleA-GPU-GTX660-x86_64-Debug ?

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

Original issue's description:
> Make GrTextContext be owned by the GrDrawContext
>
> This CL makes the GrTextContext be owned (and hidden) by the GrDrawContext. This funnels all the drawText* calls through the GrDrawContext and hides the (dispreferred) GrPipelineBuilder drawText variant.
>
> Some consequences of this are:
>
> GrDrawContext now has to get the text drawing settings (i.e., SkDeviceProperties & useDFT). This means that we need a separate GrDrawContext for each combination of pixel geometry and DFT-use.
>
> All the GrTextContext-derived classes now get a back pointer to the originating GrDrawContext so their method calls no longer take one.
>
> Committed: https://skia.googlesource.com/skia/+/5b16e740fe6ab6d679083d06f07651602265081b

TBR=joshualitt@chromium.org,joshualitt@google.com,jvanverth@google.com,reed@google.com,robertphillips@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1178383003
2015-06-16 15:03:11 -07:00
bsalomon
85ab55114f Move closeWindow()/setFullscreen()/setVSynv() from SkWindow to SkOSWindow
Rename setFullscreen to makeFullscreen, drop the param, return a bool.

Review URL: https://codereview.chromium.org/1181723006
2015-06-16 12:47:25 -07:00
robertphillips
5b16e740fe Make GrTextContext be owned by the GrDrawContext
This CL makes the GrTextContext be owned (and hidden) by the GrDrawContext. This funnels all the drawText* calls through the GrDrawContext and hides the (dispreferred) GrPipelineBuilder drawText variant.

Some consequences of this are:

GrDrawContext now has to get the text drawing settings (i.e., SkDeviceProperties & useDFT). This means that we need a separate GrDrawContext for each combination of pixel geometry and DFT-use.

All the GrTextContext-derived classes now get a back pointer to the originating GrDrawContext so their method calls no longer take one.

Review URL: https://codereview.chromium.org/1175553002
2015-06-16 12:23:47 -07:00
bsalomon
48297f72fb Allow skia_win.cpp to be compiled in CONSOLE or GUI mode.
Make visualbench and SampleApp build in CONSOLE mode so that we can see stdout.

I verified that by undoing the gyp modifications both tools will build as GUI.

Review URL: https://codereview.chromium.org/1185303004
2015-06-16 12:21:00 -07:00
robertphillips
c3176aa5e5 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

Review URL: https://codereview.chromium.org/1152553006
2015-06-16 09:44:56 -07:00
hendrikw
446ee67fda skia: Add runtime option to disable picture IO security precautions
Replaced the compile time file IO security setting with a runtime setting.

Unfortunately the setting is global.

Review URL: https://codereview.chromium.org/1183853003
2015-06-16 09:28:37 -07:00
bsalomon
1e7951ffdb There are still things to sort out but this seems to run correctly.
Review URL: https://codereview.chromium.org/1187643002
2015-06-16 07:04:43 -07:00
bungeman
5cf19498f9 Refactor SkFontHost_linux into SkFontMgr_custom.
Review URL: https://codereview.chromium.org/1184923002
2015-06-15 15:17:21 -07:00
fmalita
109a23d64f Remove the SkCanvas comment API
No longer used in Chromium/Blink.

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

Review URL: https://codereview.chromium.org/1153593003
2015-06-15 13:15:31 -07:00
junov
da5469d7bc Invalidate GrTexture mipmap on content change notification
This fix is necessary to correctly propagate invalidations that
are external to skia. For example, when drawing video or WebGL
into a 2D canvas in Chrome, with mipmaps enabled.

BUG=crbug.com/498356
TEST=GrTextureMipMapInvalidationTest

Review URL: https://codereview.chromium.org/1177843007
2015-06-15 09:48:15 -07:00
fmalita
fd674ddbd6 Remove SkDrawPictureCallback
No longer used in Chromium.

R=reed@google.com

[mtklein mischief]
No one objects to removing dead API...
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1151633003
2015-06-15 06:56:22 -07:00
cdalton
626e1ffe84 Import functionality for new GL backend
Brings in the following functionality:

  ARB_draw_instanced
  ARB_instanced_arrays
  NV_bindless_texture
  EXT_direct_state_access
  KHR_debug

Also cleans up some of the NVPR extension loading.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/202c4c75fb806f751cf796850bf67fe9793e0643

Review URL: https://codereview.chromium.org/1185573003
2015-06-12 13:56:46 -07:00
joshualitt
030dc847dc Visual bench on native android
BUG=skia:

Review URL: https://codereview.chromium.org/1164403002
2015-06-12 12:51:44 -07:00
djsollen
1fe1858a90 Revert of Import functionality for new GL backend (patchset #2 id:20001 of https://codereview.chromium.org/1185573003/)
Reason for revert:
breaking multiple builds. For example...

https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-Golo-GPU-GT610-x86_64-Debug-ASAN/builds/667

Original issue's description:
> Import functionality for new GL backend
>
> Brings in the following functionality:
>
>   ARB_draw_instanced
>   ARB_instanced_arrays
>   NV_bindless_texture
>   EXT_direct_state_access
>   KHR_debug
>
> Also cleans up some of the NVPR extension loading.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/202c4c75fb806f751cf796850bf67fe9793e0643

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

Review URL: https://codereview.chromium.org/1184863002
2015-06-12 12:01:15 -07:00
cdalton
202c4c75fb Import functionality for new GL backend
Brings in the following functionality:

  ARB_draw_instanced
  ARB_instanced_arrays
  NV_bindless_texture
  EXT_direct_state_access
  KHR_debug

Also cleans up some of the NVPR extension loading.

BUG=skia:

Review URL: https://codereview.chromium.org/1185573003
2015-06-12 10:31:36 -07:00
cdalton
1dd0542ca3 Review URL: https://codereview.chromium.org/1166513002 2015-06-12 09:01:19 -07:00
vbuzinov
dded69693d Implement support for mixed sampled render targets
Adds a new FBO type kStencil_MSFBOType that is selected whenever
NV_framebuffer_mixed_samples extension is available.  In this new
FBO type a non-msaa color buffer is created with a multisampled
stencil buffer attachment.

Replaces numSamples() with separate numColorSamples and numStencilSamples
methods in RenderTarget.

In mixed samples mode non-MSAA codepaths are used to draw simple shapes,
while NVPR-rendered paths and text are rendered with a multisampled
stencil.

BUG=skia:3177

Review URL: https://codereview.chromium.org/1001503002
2015-06-12 08:59:45 -07:00
cdalton
ee0175f1b0 Move blend enums into GrBlend.h
Moves blend enums from GrXferProcessor.h to GrBlend.h, makes GrBlend.h
public.

BUG=skia:

Review URL: https://codereview.chromium.org/1180713008
2015-06-12 08:21:26 -07:00
reed
8f086023bf fix deserialization after FirstDirection change to paths
BUG=skia:

Review URL: https://codereview.chromium.org/1185453003
2015-06-11 14:22:19 -07:00
reed
7147cc1500 retro add copyright
BUG=skia:
NOTRY=True
TBR=

Review URL: https://codereview.chromium.org/1183463002
2015-06-11 08:03:32 -07:00
cdalton
4cd6713af1 Init GrGLSLCaps fields from inside GrGLCaps
Fixes circular dependencies by allowing the initialization to be done
intertwined.

BUG=skia:

Review URL: https://codereview.chromium.org/1177053002
2015-06-10 19:23:46 -07:00
reed
026beb52a2 SkPath::Direction serves two masters:
- input param to addFoo (e.g. addRect), where only CW or CCW are valid)
- output param from computing functions, that sometimes return kUnknown

This CL's intent is to split these into distinct enums/features:
- Direction (public) loses kUnknown, and is only used for input
- FirstDirection (private) is used for computing the first direction we see when analyzing a contour

BUG=skia:

Review URL: https://codereview.chromium.org/1176953002
2015-06-10 14:23:15 -07:00
fmalita
523beb7fd9 Label some unused static vars as SK_UNUSED
Makes my gcc 5.1.1 much happier.

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

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

Review URL: https://codereview.chromium.org/1170863006
2015-06-10 10:46:50 -07:00
bsalomon
55812362f1 Towards removing getTexture() on SkImage
Review URL: https://codereview.chromium.org/1166993002
2015-06-10 08:49:28 -07:00
mtklein
519580553a Use SkMScalar as float by default to match Chromium.
Tweak some test values to pass with floats.

As expected, this regresses matrix44_setconcat_general by about 2x.

BUG=skia:

Review URL: https://codereview.chromium.org/1169813006
2015-06-09 15:06:22 -07:00
reed
41e010cb90 Revert[2] SkDraw and all Blitters to use pixmap instead of bitmapi
This reverts commit b3f0ec9f99.

BUG=skia:

Review URL: https://codereview.chromium.org/1168303006
2015-06-09 12:16:53 -07:00
mtklein
1831f990c3 A bunch of little SkMScalar-as-float build fixes.
Landing this before http://crrev.com/1169813006 so the test changes needed
there are clearer.  This just lets things build with floats, and is a no-op for
doubles.

No public API changes we didn't intend to already have...
TBR=reed@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/1173673003
2015-06-09 11:47:01 -07:00
reed
2c55d7b7f3 remove subclassing from ImageFilter::Proxy
BUG=skia:

Review URL: https://codereview.chromium.org/1172693002
2015-06-09 08:18:40 -07:00
reed
ded9a6f794 remove Proxy entrypoints for canHandleFilter
BUG=skia:

Review URL: https://codereview.chromium.org/1169923002
2015-06-09 06:38:49 -07:00
reed
b3f0ec9f99 Revert of change SkDraw and all Blitters to use pixmap instead of bitmap (patchset #6 id:100001 of https://codereview.chromium.org/1148793007/)
Reason for revert:
speculative revert to try to unblock DEPS roll

Original issue's description:
> change SkDraw and all Blitters to use pixmap instead of bitmap
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/c31af44336f5eb4a50e83e76e51962d46c3ed458

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

Review URL: https://codereview.chromium.org/1164373003
2015-06-08 19:58:07 -07:00
cdalton
86ae0a9e46 Add mixed samples support to XPs
BUG=skia:

Review URL: https://codereview.chromium.org/1164973002
2015-06-08 15:11:04 -07:00
bungeman
d6e9fc7f1f Restore support for 10.6 SDK in header.
Must use ApplicationServices, can't use CoreText directly.
2015-06-08 17:47:06 -04:00
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
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