Commit Graph

341 Commits

Author SHA1 Message Date
bsalomon
41b952c296 Add deferred texture upload API.
Performs thread-safe decoding of SkImage in order to later create a texture-backed SkImage.

The client allocates storage for the data.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1776693002

Review URL: https://codereview.chromium.org/1776693002
2016-03-11 06:46:33 -08:00
bsalomon
b8fea97a7a Make copySurface work for texture dsts, return a bool, & add unit test.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1684313002

Committed: https://skia.googlesource.com/skia/+/7ea5e28065e5eb797e95f5d81c1a65cf3209d741

Review URL: https://codereview.chromium.org/1684313002
2016-02-16 07:34:17 -08:00
kjlubick
0eed945294 Revert of Make copySurface work for texture dsts, return a bool, & add unit test. (patchset #6 id:100001 of https://codereview.chromium.org/1684313002/ )
Reason for revert:
Copy surface tests are not happy for Windows, Android and probably others:
https://uberchromegw.corp.google.com/i/client.skia.android/builders/Test-Android-GCC-Nexus7-GPU-Tegra3-Arm7-Release/builds/4161
https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Win8-MSVC-ShuttleA-GPU-GTX960-x86_64-Release/builds/3694

Original issue's description:
> Make copySurface work for texture dsts, return a bool, & add unit test.
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1684313002
>
> Committed: https://skia.googlesource.com/skia/+/7ea5e28065e5eb797e95f5d81c1a65cf3209d741

TBR=robertphillips@google.com,bsalomon@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1690053002
2016-02-11 12:05:24 -08:00
bsalomon
7ea5e28065 Make copySurface work for texture dsts, return a bool, & add unit test.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1684313002

Review URL: https://codereview.chromium.org/1684313002
2016-02-11 11:42:31 -08:00
bsalomon
6c9cd55f00 Make swizzling in read/write pixel copy code more generic
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1617433002

Review URL: https://codereview.chromium.org/1617433002
2016-01-22 07:17:34 -08:00
joshualitt
ce894007eb Guard SkGpuDevice
TBR=bsalomon@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1567093002

Review URL: https://codereview.chromium.org/1567093002
2016-01-11 13:29:31 -08:00
joshualitt
5651ee6376 Change to wire up opnames in SkGpuDevice
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1565113004

Review URL: https://codereview.chromium.org/1565113004
2016-01-11 10:39:11 -08:00
joshualitt
de8dc7e920 Reland of Make a single GrSingleOwner in GrContext (patchset #1 id:1 of https://codereview.chromium.org/1565303003/ )
Reason for revert:
trying again

Original issue's description:
> Revert of Make a single GrSingleOwner in GrContext (patchset #3 id:40001 of https://codereview.chromium.org/1563703004/ )
>
> Reason for revert:
> breaking asan
>
> Original issue's description:
> > Make a single GrSingleOwner in GrContext
> >
> > TBR=bsalomon@google.com
> > BUG=skia:
> > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1563703004
> >
> > Committed: https://skia.googlesource.com/skia/+/f9bc796e0dbd31674c22b34761913ee6e8fdd66a
>
> TBR=robertphillips@google.com,joshualitt@chromium.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/94da292e39db0d41da08b1d6055ca5e0d6b498cc

TBR=robertphillips@google.com,joshualitt@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1572653002
2016-01-08 10:09:13 -08:00
joshualitt
27a48dc0cd Create stub GrAuditTrail class
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1572553002

Review URL: https://codereview.chromium.org/1572553002
2016-01-08 07:19:47 -08:00
joshualitt
94da292e39 Revert of Make a single GrSingleOwner in GrContext (patchset #3 id:40001 of https://codereview.chromium.org/1563703004/ )
Reason for revert:
breaking asan

Original issue's description:
> Make a single GrSingleOwner in GrContext
>
> TBR=bsalomon@google.com
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1563703004
>
> Committed: https://skia.googlesource.com/skia/+/f9bc796e0dbd31674c22b34761913ee6e8fdd66a

TBR=robertphillips@google.com,joshualitt@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1565303003
2016-01-07 13:22:24 -08:00
joshualitt
f9bc796e0d Make a single GrSingleOwner in GrContext
TBR=bsalomon@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1563703004

Review URL: https://codereview.chromium.org/1563703004
2016-01-07 11:32:40 -08:00
joshualitt
1de610a528 Create debug only SkSingleOwner
This is so Gpu code can guard against improper multithreaded usage in
debug builds

TBR=bsalomon@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1555953004

Review URL: https://codereview.chromium.org/1555953004
2016-01-06 08:26:09 -08:00
jvanverth
0671b967eb Move texture drawing utility method to SkGpuDevice
BUG=skia:4542

Review URL: https://codereview.chromium.org/1506203002
2015-12-08 18:53:44 -08:00
joshualitt
dc5685ac37 Wire up resource cache stats dumping in nanobench
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1495543003
2015-12-02 14:08:25 -08:00
joshualitt
e45c81c8f3 Began logging more gpu stats from nanobench
BUG=skia:

Review URL: https://codereview.chromium.org/1489033004
2015-12-02 09:05:38 -08:00
bsalomon
69cfe95b7b Add debug option to clip each GrBatch to its device bounds
Review URL: https://codereview.chromium.org/1471083002
2015-11-30 13:27:47 -08:00
robertphillips
504ce5dc77 Optionally pass rendertarget to getTestTarget
This shouldn't really make any difference but allocating and holding on to a GrRenderTarget for each test target generates image differences for Mali GPUs. This CL allows an existing render target to be used for the test target.

TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/1447113002
2015-11-16 11:02:05 -08:00
robertphillips
caef345048 Readd "immediate" mode
This isn't an exact replacement. The accumulated batches are now flushed at drawContext-entry-point granularity (via the AutoCheckFlush objects) rather than per batch.

TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/1439533003
2015-11-11 13:18:11 -08:00
robertphillips
a13e202563 Move GrBatchFlushState from GrDrawTarget to GrDrawingManager
This CL:
  moves the flushState
  disables immediate mode (it was proving difficult to implement)
  also moves the program unit test to the drawing manager

BUG=skia:4094
TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/1437843002
2015-11-11 12:01:09 -08:00
jvanverth
629162dd8e Add text animation sample; tweak DrawShip sample
Committed: https://skia.googlesource.com/skia/+/3b484a40b3be7f0262afadeaf6b741ba5cedcfe1

Review URL: https://codereview.chromium.org/1410663005
2015-11-08 08:07:24 -08:00
jvanverth
d75ccc6a0a Revert of Add text animation sample; tweak DrawShip sample (patchset #3 id:40001 of https://codereview.chromium.org/1410663005/ )
Reason for revert:
CrOS bots failing.

Original issue's description:
> Add text animation sample; tweak DrawShip sample
>
> Committed: https://skia.googlesource.com/skia/+/3b484a40b3be7f0262afadeaf6b741ba5cedcfe1

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

Review URL: https://codereview.chromium.org/1408063015
2015-11-06 16:10:34 -08:00
jvanverth
3b484a40b3 Add text animation sample; tweak DrawShip sample
Review URL: https://codereview.chromium.org/1410663005
2015-11-06 14:20:04 -08:00
robertphillips
687378229a Remove GrPipelineBuilder from getPathRenderer call
Logically this CL:

Moves the PathRendererChain from GrContext to GrDrawManager
   - this was needed to untangled the Path-Chain/Renderer header mess
   - this entailed adding getDrawingMgr so the CMM could access the PathRenderingChain
   - this also entailed re-adding freeGpuResources to the GrDrawingMgr
Moves the CanDrawArgs struct up stack
Removes the GrPipelineBuilder from the CanDrawArgs struct

Review URL: https://codereview.chromium.org/1407883004
2015-10-29 12:12:21 -07:00
robertphillips
cf10b5a432 Cosmetic portion of reverted "Fix ClipMaskManager's SW-fallback logic" CL
This CL isolates the cosmetic portion so the functional portion is clearer. It relies on https://codereview.chromium.org/1412883005/ (Fix ClipMaskManager's SW-fallback logic (take 2))

Review URL: https://codereview.chromium.org/1422023003
2015-10-27 07:53:35 -07:00
robertphillips
24cdec1744 Revert of Fix ClipMaskManager's SW-fallback logic (patchset #4 id:60001 of https://codereview.chromium.org/1421533007/ )
Reason for revert:
Logic may be incorrect

Original issue's description:
> Fix ClipMaskManager's SW-fallback logic
>
>
> 'useSWOnlyPath' was not correctly toggling between stencil and color draws so there was a mismatch with the behavior in createAlphaClipMask (i.e., we were inadvertently rendering some of the elements in a clip using SW but using stenciling for others - precisely what 'useSWOnlyPath' was intended to prevent).
>
> Committed: https://skia.googlesource.com/skia/+/5c3ea4cd3921e8904d4f201bcdedfd5b8a726542

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

Review URL: https://codereview.chromium.org/1426443008
2015-10-26 14:12:25 -07:00
robertphillips
5c3ea4cd39 Fix ClipMaskManager's SW-fallback logic
'useSWOnlyPath' was not correctly toggling between stencil and color draws so there was a mismatch with the behavior in createAlphaClipMask (i.e., we were inadvertently rendering some of the elements in a clip using SW but using stenciling for others - precisely what 'useSWOnlyPath' was intended to prevent).

Review URL: https://codereview.chromium.org/1421533007
2015-10-26 08:33:10 -07:00
robertphillips
b83bec5e04 Narrow the distribution of GrDrawTarget a bit
BUG=skia:4094
TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/1420043002
2015-10-23 09:38:03 -07:00
bsalomon
648c696438 Add immediate mode option for gpu configs in dm
Review URL: https://codereview.chromium.org/1421853002
2015-10-23 09:06:59 -07:00
robertphillips
77a2e52c7d Remove DrawingMgr shims from GrContext
BUG=skia:4094

Review URL: https://codereview.chromium.org/1413673002
2015-10-17 07:43:27 -07:00
robertphillips
a106c62753 Loosen requirement that there be only one GrDrawTarget
BUG=skia:4094

Review URL: https://codereview.chromium.org/1406173003
2015-10-16 09:07:06 -07:00
robertphillips
2e1e51f049 GrDrawContext now holds GrRenderTarget pointer
Review URL: https://codereview.chromium.org/1404823005
2015-10-15 08:01:49 -07:00
bsalomon
4a33952961 Bye bye processor data manager.
Review URL: https://codereview.chromium.org/1388113002
2015-10-06 08:40:51 -07:00
robertphillips
2d70dcbe5c Dynamically allocate the GrDrawContexts
This CL moves the allocation and storage of the GrTextContexts into the DrawingManager. The GrDrawContexts now just get their GrTextContext from the DrawingManager.

Review URL: https://codereview.chromium.org/1375153007
2015-10-06 07:38:23 -07:00
bsalomon
473addf176 Remove separate cache for clip mask textures
Review URL: https://codereview.chromium.org/1377943003
2015-10-02 07:49:06 -07:00
herb
62a69c26b3 Move Mutexy things to private.
There is no API change.

TBR=reed@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/1368333004
2015-09-29 11:47:45 -07:00
ericrk
0a5fa484fd Add onMemoryDump to GrContext
Adds an entry point to GrContext to allow enumeration and tracing of GPU resources
via the newly added SkTraceMemoryDump.

Plan is for Chrome to call this on each of its GrContexts.

Dumps both the total size of GPU resources, as well as the total purgeable size.

BUG=526261

Review URL: https://codereview.chromium.org/1313743002
2015-09-15 14:16:10 -07:00
bsalomon
6c6f65885b Add a mutex to GrContext::readSurfacePixels to protect against multiple CPU raster threads accessing the same GrContext to read back GPU input data
BUG=chromium:524717

TBR=reed@google.com

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

Review URL: https://codereview.chromium.org/1329313002
2015-09-10 08:12:46 -07:00
bsalomon
32ab260ee1 Revert of Add a mutex to GrContext::readSurfacePixels to protect against multiple CPU raster threads accessin… (patchset #1 id:1 of https://codereview.chromium.org/1329313002/ )
Reason for revert:
breaking the bots

Original issue's description:
> Add a mutex to GrContext::readSurfacePixels to protect against multiple CPU raster threads accessing the same GrContext to read back GPU input data
>
> BUG=chromium:524717
>
> TBR=reed@google.com
>
> Committed: https://skia.googlesource.com/skia/+/eb662bc407cec0585a821946fef123102cae64db

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

Review URL: https://codereview.chromium.org/1334603002
2015-09-09 18:57:49 -07:00
bsalomon
eb662bc407 Add a mutex to GrContext::readSurfacePixels to protect against multiple CPU raster threads accessing the same GrContext to read back GPU input data
BUG=chromium:524717

TBR=reed@google.com

Review URL: https://codereview.chromium.org/1329313002
2015-09-09 18:05:03 -07:00
joshualitt
dac7005b87 Remove GrGpuTraceMarker hooks until we rethink the design
TBR=bsalomon@google.com
BUG=526308

Review URL: https://codereview.chromium.org/1323823003
2015-09-01 08:19:46 -07:00
joshualitt
da04e0e80a Allow setting of GrBatchFontCache atlas sizes
BUG=skia:

Review URL: https://codereview.chromium.org/1255943006
2015-08-19 08:16:43 -07:00
joshualitt
14205b114a Expand functionality of GrRectBatchFactory with AARects
BUG=skia:

Review URL: https://codereview.chromium.org/1279303002
2015-08-10 11:40:56 -07:00
joshualitt
17d833b05b Add abliity to set textblob cache budget to GrContext
BUG=skia:

Review URL: https://codereview.chromium.org/1264283002
2015-08-03 10:17:44 -07:00
bsalomon
636e8024f8 Skip temp texture when config conversion test has already failed.
Review URL: https://codereview.chromium.org/1261033005
2015-07-29 06:08:46 -07:00
bsalomon
e8d21e8f24 Make readpixels work on GrTextures
Review URL: https://codereview.chromium.org/1234313002
2015-07-16 08:23:13 -07:00
joshualitt
5f10b5c1b5 More threading of GrProcessorDataManager
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1230813003
2015-07-09 10:24:36 -07:00
robertphillips
31dc1b2db0 style nit cleanups. e.g. remove 'virtual' on override declarations
Review URL: https://codereview.chromium.org/1216433005
2015-07-07 10:05:18 -07:00
bsalomon
c49e8682ab Rename flushForExternalRead->flushForExternalIO and always call in SkSurface::getTextureHandle
Review URL: https://codereview.chromium.org/1216243003
2015-06-30 11:37:35 -07:00
mtklein
2766c00fc0 remove SkInstCnt
It's been outclassed by Valgrind and leak sanitizer,
and it seems to be causing problems for external folks building Skia.

I'm not sure why our own builds seem unaffected.

Latest thread:
https://groups.google.com/forum/#!topic/skia-discuss/oj9FsQwwSF0

BUG=skia:

Review URL: https://codereview.chromium.org/1217573002
2015-06-26 11:45:03 -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