Commit Graph

4611 Commits

Author SHA1 Message Date
robertphillips
1b8e1b5c49 Refactor GrBufferAllocPools to use resource cache
Committed: https://skia.googlesource.com/skia/+/e935f1a0e2351373c33600b8388492ce1218014a

Review URL: https://codereview.chromium.org/1139753002
2015-06-24 06:54:10 -07:00
reed
8bcc7a00fe remove SK_SUPPORT_LEGACY_PATHOP_ENUMS
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1200323005
2015-06-23 22:05:19 -07:00
reed
af4b233d46 remove SK_SUPPORT_LEGACY_FILTERLEVEL_ENUM
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1205803002
2015-06-23 21:47:30 -07:00
reed
56b73fc63f remove (legacy) NewFromData
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1199413003
2015-06-23 21:31:08 -07:00
bsalomon
74f681dce2 Make SkGpuDevice know its alpha type
Make SkImage_Gpu snapshots opaque if surface is opaque.

BUG=skia:3965

Review URL: https://codereview.chromium.org/1205643002
2015-06-23 14:38:48 -07:00
cdalton
d416a5b10f Implement SkGLContext swapBuffers with fence syncs
Improves the GPU measuring accuracy of nanobench by using fence syncs.
Fence syncs are very widely supported and available on almost every
platform.

NO_MERGE_BUILDS
BUG=skia:

Review URL: https://codereview.chromium.org/1194783003
2015-06-23 13:23:44 -07:00
robertphillips
b607767703 Revert of Refactor GrBufferAllocPools to use resource cache (patchset #15 id:280001 of https://codereview.chromium.org/1139753002/)
Reason for revert:
Will reland after Chromium branch

Original issue's description:
> Refactor GrBufferAllocPools to use resource cache
>
> Committed: https://skia.googlesource.com/skia/+/e935f1a0e2351373c33600b8388492ce1218014a

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

Review URL: https://codereview.chromium.org/1204773003
2015-06-23 12:36:12 -07:00
reed
e582a5a891 remove SK_SUPPORT_LEGACY_OPTIONLESS_GET_PIXELS
BUG=skia:

Review URL: https://codereview.chromium.org/1201233002
2015-06-23 12:10:27 -07:00
reed
b3fe1b87e0 more tests for offsetimagefilter
BUG=skia:

Review URL: https://codereview.chromium.org/1199933011
2015-06-23 08:29:20 -07:00
robertphillips
e935f1a0e2 Refactor GrBufferAllocPools to use resource cache
Review URL: https://codereview.chromium.org/1139753002
2015-06-23 08:23:08 -07:00
kkinnunen
591a2ca842 Stop using the NVPR glyph loading functionality
Remove the NVPR glyph loading functionality. A bit risky feature.

Review URL: https://codereview.chromium.org/1176113008
2015-06-23 07:27:41 -07:00
tomhudson
3fef728e16 Fix indirect use of defined() directive
BUG=432391
R=bsalomon,bungeman1

Review URL: https://codereview.chromium.org/876933004
2015-06-23 06:31:32 -07:00
robertphillips
702edbd4bc Propagate SkSurfaceProps to more call sites
Start moving to a world where everyone provides surface properties.

Most notably this exposes a portion of SkSurfaceProps to the C API.

BUG=skia:3934

Review URL: https://codereview.chromium.org/1195003003
2015-06-23 06:26:08 -07:00
reed
871872f3f2 change old picture serialization to really handle images
BUG=skia:3965

Review URL: https://codereview.chromium.org/1199473002
2015-06-22 12:48:26 -07:00
robertphillips
efbffedd68 Clean up usage of SkSurfaceProps
This CL continues cleaning up Skia's usage of SkSurfaceProps. It:

  Removes the duplicate SkSurfaceProps object from SkImageFilter::Proxy.

  Removes a dispreferred ctor from SkCanvas

  Removes the initForRootLayer entry point from SkDevice (since the root device and the canvas should always have the same pixel geometry now).

Review URL: https://codereview.chromium.org/1201983006
2015-06-22 12:06:08 -07:00
robertphillips
9a53fd7c41 Begin kLegacyFontHost_InitType cleanup
This CL starts the process of pushing kLegacyFontHost_InitType-type SkSurfaceProps up the call stack and out of Skia. It:

 Gets rid of the default SkBaseDevice ctor. This means everyone has to always hand an explicit SkSurfaceProps to it.

 It makes public the SkBitmapDevice creation methods that require SkSurfaceProps.

 Removes (in Skia's code base) all SkBitmapDevice ctor calls w/o SkSurfaceProps.

 Makes the "recording" canvases (e.g., pdf, svg, xps) explicitly not use kLegacyFontHost_InitType.

 Replicates the creating canvas/device's flags on saveLayer devices

BUG=skia:3934

Review URL: https://codereview.chromium.org/1204433002
2015-06-22 09:46:59 -07:00
jvanverth
4854d13c27 Remove distance field flag from SkPaint
Review URL: https://codereview.chromium.org/1192413005
2015-06-22 06:46:56 -07:00
robertphillips
7b05ff11eb Rename all things "leaky" in SkDevice
Review URL: https://codereview.chromium.org/1198603002
2015-06-19 14:14:55 -07:00
robertphillips
fcf7829b67 remove SkDeviceProperties
There is a lot more clean up to do here but this is probably a big enough bite.

Review URL: https://codereview.chromium.org/1196683003
2015-06-19 11:49:52 -07:00
robertphillips
8b1fa6dd8d Fix precision error in https://codereview.chromium.org/1188433011/
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1192853002
2015-06-19 06:40:02 -07:00
robertphillips
20eee3f047 Added check for ill-conditioned invert
sk_inv_determinant has a guard that the determinant can't get too big so this CL only checks if the determinant gets too small.

BUG=492263

Review URL: https://codereview.chromium.org/1188433011
2015-06-19 05:14:26 -07:00
reed
ce777c9ea3 remove deprecated NewRasterPMColor
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1192353002
2015-06-19 03:42:56 -07:00
joshualitt
83bc229703 Work around for nexus 6 TexSubImage issue
BUG=skia:

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

Review URL: https://codereview.chromium.org/1173203005
2015-06-18 14:18:03 -07:00
reed
35a5261085 privatize
BUG=skia:
TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/1189173005
2015-06-18 14:05:07 -07:00
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