Commit Graph

390 Commits

Author SHA1 Message Date
Brian Salomon
69225d0250 Make SkTArray not allocate unless reserve or initial count > 0
This also makes it so that it doesn't shrink back into preallocated storage and therefore doesn't need to store the reserve count.

Change-Id: Ia320fed04c329641a5494947db39cefd2fb6d80f
Reviewed-on: https://skia-review.googlesource.com/9531
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-03-16 13:08:04 +00:00
Robert Phillips
a4c41b3e83 Push setMipColorMode calls further down-stack & add to GrTextureProxy
setMipColorMode seems like an odd call. 

Change-Id: I24a1ac3883d52499f3be27282d006144d15b26f1
Reviewed-on: https://skia-review.googlesource.com/9725
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-03-15 18:34:32 +00:00
Robert Phillips
26c90e0479 Add GrRenderTargetContext::resourceProvider & GrResourceProvider::caps
and retract GrSurfaceContextPriv a bit

Change-Id: Id47af1052f9bda4fe7c85b3ce46b3ebe37797524
Reviewed-on: https://skia-review.googlesource.com/9647
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-03-14 21:23:44 +00:00
Robert Phillips
d3749485db Consolidate Proxy caching code in GrResourceProvider
This doesn't implement the GrSurfaceProxy-based caching but just carves out a space for it.

Split out of: https://skia-review.googlesource.com/c/8823/ (Remove GrFragmentProcessor-derived class' GrTexture-based ctors)

Change-Id: Iec87b45e3264b349d7804f63e361e970b925e335
Reviewed-on: https://skia-review.googlesource.com/9626
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-03-14 14:09:12 +00:00
Robert Phillips
4f7062378e Restore deferred GPU resources in Chrome
Change-Id: Ib52668b46e7d077175dcba12a3ccc8abc1f0c7a9
Reviewed-on: https://skia-review.googlesource.com/9552
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-03-13 16:25:45 +00:00
Florin Malita
d54639f768 Add SkSTArray move assignment operators
Change-Id: Ib655a8a4d62c27dee4f92fcb644237f6fbbdb75b
Reviewed-on: https://skia-review.googlesource.com/9510
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
2017-03-12 15:15:14 +00:00
Florin Malita
053730de73 Fix SkTHashTable dangling values
The element rearrange logic in SkTHashTable::remove() marks empty slots
as such, but does not reset their value.

When breaking out of the rearrange loop, we must also reset the last empty
slot value to avoid retaining unwanted copies.

Change-Id: I8ba2a25088c0aa5210277124e0917224cb295691
Reviewed-on: https://skia-review.googlesource.com/9533
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-03-10 17:28:04 +00:00
Robert Phillips
b726d58efc Partially defer SkImage_Gpu
One of SkImageCacherator, GrBitmapTextureMaker, GrImageTextureMaker, GrTextureAdjuster, GrTextureProducer or SkImage has to take the first step. This is probably the least odd of the options.

Change-Id: Ie167034553451f4b3633a5a1548dbd4d75839b3d
Reviewed-on: https://skia-review.googlesource.com/9488
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-03-10 15:02:11 +00:00
Mike Reed
6c14c8db4b take fast case in swap() if we're using malloc OR we're empty
This avoids taking the (more expensive) copy case when we don't need to.
The old behavior only took this fast case if we were "actively" using
a dynamically allocated array.

BUG=skia:

Change-Id: I0f606ba83ff4aff3a8fc282db7a3ce1b0191fb1a
Reviewed-on: https://skia-review.googlesource.com/9521
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-03-09 22:26:12 +00:00
Brian Osman
383dd9dc58 Remove unused ownership argument to GrSurfaceProxy::MakeWrappedBackend
This is the last public reference to GrWrapOwnership, so removal paves
the way for moving it to somewhere internal.

BUG=skia:

Change-Id: I876298642ff812452a644c1d2b9519691eac44b9
Reviewed-on: https://skia-review.googlesource.com/9492
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-03-09 19:21:22 +00:00
Florin Malita
c2d5bd0117 Fix SkTArray copy construction
We can't use memcpy for copy construction, even when MEM_COPY == true.

Change-Id: I50eb369f0fbf77e8f0ad5a148c67d46df0d3ab0e
Reviewed-on: https://skia-review.googlesource.com/9487
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
2017-03-09 19:17:16 +00:00
Florin Malita
b1d800dc22 SkSTArray move ctor
Change-Id: Ice90a229e1ca5959b365c678e8df332cd6ed4a03
Reviewed-on: https://skia-review.googlesource.com/9489
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-03-09 18:21:09 +00:00
Herb Derby
3139de39d7 Remove SkChunckAlloc
Change-Id: Ia400dd2d8aa398cf53852acd71c4a45228752496
Reviewed-on: https://skia-review.googlesource.com/9328
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2017-03-08 20:06:15 +00:00
Mike Klein
4b19b40394 Revert "Fix new IT blocks ARMv8"
This reverts commit 90165c2269.

Reason for revert: Skia and Chrome iOS builds broken.

../../third_party/skia/include/private/SkFixed.h:106:41: error: invalid output constraint '+t' in asm
        asm("vcvt.s32.f32 %0, %0, #16": "+t"(x));


Original change's description:
> Fix new IT blocks ARMv8
> 
> ARMv8 specifies that an IT block should be followed by only one 16-bit instruction.
> * SkFloatToFix is back to a C implementation that mirrors the assembly code.
> 
> * S32A_D565_Opaque_neon switched the usage of the temporary 'ip' register to let
> the compiler choose what is best in the context of the IT block. And replaced
> 'keep_dst' by 'ip' where low register or high register does not matter.
> 
> BUG=skia:
> 
> CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD
> 
> Change-Id: I096759841c972e9300c1d0293bc80d3c3ff2747b
> Reviewed-on: https://skia-review.googlesource.com/9340
> Reviewed-by: Mike Klein <mtklein@chromium.org>
> Commit-Queue: Mike Klein <mtklein@chromium.org>
> 

TBR=mtklein@chromium.org,amaury.leleyzour@arm.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: Idbcbda88039066153e1c34233d43366ab114fd01
Reviewed-on: https://skia-review.googlesource.com/9332
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-03-07 00:55:02 +00:00
Amaury Le Leyzour
90165c2269 Fix new IT blocks ARMv8
ARMv8 specifies that an IT block should be followed by only one 16-bit instruction.
* SkFloatToFix is back to a C implementation that mirrors the assembly code.

* S32A_D565_Opaque_neon switched the usage of the temporary 'ip' register to let
the compiler choose what is best in the context of the IT block. And replaced
'keep_dst' by 'ip' where low register or high register does not matter.

BUG=skia:

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: I096759841c972e9300c1d0293bc80d3c3ff2747b
Reviewed-on: https://skia-review.googlesource.com/9340
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-03-06 22:16:17 +00:00
Brian Osman
32342f032e Rebase and fix chromium
Combine texture provider and resource provider

Largely mechanical. Only three places that were calling createApprox
via texture provider (ie without flags), so that was simple.

BUG=skia:

Change-Id: I876367bcdc6a8db736deedab1028de1972015509
Reviewed-on: https://skia-review.googlesource.com/9176
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-03-04 13:49:47 +00:00
Robert Phillips
2f49314227 Make GrSurface::MakeDeferred return sk_sp<GrTextureProxy>
This should make upcoming changes less tedious

Change-Id: I313ae9df724f109a64cf5708a974e8bfeb963025
Reviewed-on: https://skia-review.googlesource.com/9183
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-03-03 12:35:27 +00:00
Brian Salomon
5ff3a5c13e Remove stencil related flags from GrInstancedPipelineInfo.
Change-Id: Ieeb8ada92b5196473d5cea77350fd994bfff8916
Reviewed-on: https://skia-review.googlesource.com/9086
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-03-01 20:16:45 +00:00
Robert Phillips
7928e76872 Disable deferred gpu resources for Chrome branch
Chrome's branch is coming up and it seems unlikely that I will be able to push instantiation all the way to flush time (where failure will be easier to deal with) before then. This CL should silence the P1 bug but could introduce layout test diffs.

Ideally this wouldn't land until after: https://codereview.chromium.org/2718353004/ (Add flag for upcoming Skia change) so the layout test differences will be visible on the DEPS roll

BUG=688811

Change-Id: I86c42ee02e6672834353aa7126b00ed4f3521948
Reviewed-on: https://skia-review.googlesource.com/9064
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-03-01 12:30:02 +00:00
Brian Salomon
dac5f6bcbe Fix -Wshadow-field warnings
BUG=skia:

Change-Id: I44f1e11787eab88bdc5ed25c34ea802e9001d427
Reviewed-on: https://skia-review.googlesource.com/9083
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-02-28 21:49:28 +00:00
Robert Phillips
c787e495e2 Allow GrSurfaceProxy-derived classes to use flags when instantiating (take 2)
In some instances proxies must be created that, when instantiated, have no pending IO.

This is split out of:

https://skia-review.googlesource.com/c/8679/ (Add per-Flush callback to GrDrawingManager)

and is a reland of:

https://skia-review.googlesource.com/c/8988/ ( Allow GrSurfaceProxy-derived classes to use flags when instantiating)

Change-Id: I36f52a6d249e762bdfc1f0d7528aba6d4071e492
Reviewed-on: https://skia-review.googlesource.com/9070
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-02-28 17:21:55 +00:00
Robert Phillips
2411c1112e Revert "Allow GrSurfaceProxy-derived classes to use flags when instantiating"
This reverts commit c8f1e3a5c0.

Reason for revert: check on ANGLE failure
Original change's description:
> Allow GrSurfaceProxy-derived classes to use flags when instantiating
> 
> In some instances proxies must be created that, when instantiated, have no pending IO.
> 
> This is split out of: (Add per-Flush callback to GrDrawingManager)
> 
> https://skia-review.googlesource.com/c/8679/
> 
> Change-Id: I68b5504d35ad436a4ae737ac4bb3c171fc9a5826
> Reviewed-on: https://skia-review.googlesource.com/8988
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> 

TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I157417c443028b2148ee355ce69c946a96bb9407
Reviewed-on: https://skia-review.googlesource.com/9066
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-02-28 15:06:07 +00:00
Robert Phillips
c8f1e3a5c0 Allow GrSurfaceProxy-derived classes to use flags when instantiating
In some instances proxies must be created that, when instantiated, have no pending IO.

This is split out of: (Add per-Flush callback to GrDrawingManager)

https://skia-review.googlesource.com/c/8679/

Change-Id: I68b5504d35ad436a4ae737ac4bb3c171fc9a5826
Reviewed-on: https://skia-review.googlesource.com/8988
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-02-28 13:40:19 +00:00
Robert Phillips
30f9bc69cf Switch GrTextureStripAtlas over to GrTextureProxies
This is split out of: https://skia-review.googlesource.com/c/8823/ (Remove GrFragmentProcessor-derived class' GrTexture-based ctors)

Change-Id: I9f602985b6010fc58b595e2be6d4e67e50179747
Reviewed-on: https://skia-review.googlesource.com/8881
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-02-23 15:01:42 +00:00
Mike Klein
19eec39c90 Fix SkSemaphore comments.
Change-Id: I14fc03fcb73bad61daed7c4cd3ed12bfae6b1217
Reviewed-on: https://skia-review.googlesource.com/8880
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-02-22 20:11:54 +00:00
Mike Klein
384b90af5c SkExecutor
Refactoring to refamiliarize myself with SkTaskGroup and SkThreadPool.

This adds an SkExecutor interface to describe how we use SkThreadPool,
with a global setter and getter for a default instance.  Then I rewrote
SkTaskGroup to work with any executor, the global default by default.

I also think I've made the SkTaskGroup::wait() borrow logic clearer
with the addition of SkSemaphore::try_wait().  This lets me keep the
semaphore count and actual count of work in perfect sync.

Change-Id: I6bbdfaeb0e2c3a43daff6192d34bc4a3f7210178
Reviewed-on: https://skia-review.googlesource.com/8836
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-02-22 16:17:39 +00:00
Robert Phillips
63c67461ed Tighten up GrSurfaceProxy typing
This may reduce the number of "why not GrTextureProxy" issues

Change-Id: I9e0e5042f5801ba9a933b697a380cb0cb54b4522
Reviewed-on: https://skia-review.googlesource.com/8510
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-02-15 20:17:29 +00:00
csmartdalton
320ade43f5 Make SkAutoTMalloc movable
BUG=skia:

Change-Id: I683407659c252656445b92734484170587c2f75a
Reviewed-on: https://skia-review.googlesource.com/8360
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-02-13 19:46:35 +00:00
Mike Reed
267be7fbc3 Revert "Revert "IWYU""
This reverts commit 3c727d2386.

BUG=skia:

Change-Id: I72e9b40fec96d044e0ac12906669a52529e77882
Reviewed-on: https://skia-review.googlesource.com/8356
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-02-13 15:59:35 +00:00
Robert Phillips
3c727d2386 Revert "IWYU"
This reverts commit 2aeae78a2c.

Reason for revert: It looks like this is breaking the android roll

out/target/product/angler/obj/SHARED_LIBRARIES/libandroid_runtime_intermediates/android_graphics_Canvas.o frameworks/base/core/jni/android_graphics_Canvas.cpp"
frameworks/base/core/jni/android_graphics_Canvas.cpp:178:15: error: incomplete type 'SkRegion' named in nested name specifier



Original change's description:
> IWYU
> 
> BUG=skia:
> 
> Change-Id: Ib6b4d52841dbe3fa69a86ddb6b97d6a5d0f004ee
> Reviewed-on: https://skia-review.googlesource.com/8231
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>
> 

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

Change-Id: If979c3dd9dc3fe08ac450ced113b3d1e9a86f02a
Reviewed-on: https://skia-review.googlesource.com/8346
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-02-11 01:25:19 +00:00
Mike Reed
2aeae78a2c IWYU
BUG=skia:

Change-Id: Ib6b4d52841dbe3fa69a86ddb6b97d6a5d0f004ee
Reviewed-on: https://skia-review.googlesource.com/8231
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2017-02-10 19:43:03 +00:00
Florin Malita
63b6156273 Fixed3232 overflow in LinearGradientContext::shadeSpan()
Speculative fix for TAP ubsan failures.

Change-Id: Id3a78adbfab04ba3404a23059cbd8c162d812c2e
Reviewed-on: https://skia-review.googlesource.com/8315
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-02-10 16:17:35 +00:00
Hal Canary
6b20a55996 Make header files self-sufficient
Change-Id: Ice7d761b1023da77e50e5d6aa597964f7d9aa1d8
Reviewed-on: https://skia-review.googlesource.com/8302
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2017-02-10 01:19:52 +00:00
csmartdalton
b37cb236c3 Add integer vectors to GrSLType
BUG=skia:

Change-Id: I4a4a50e214f2240d83f6f0b02cf43e695c067933
Reviewed-on: https://skia-review.googlesource.com/8122
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-02-08 21:37:22 +00:00
Ben Wagner
3c5cfb0d15 Remove exec bit from source files.
Ran:
find src include \( -name '*.cpp' -o -name '*.h' \) -executable -exec chmod -x {} \;

BUG=skia:

Change-Id: I04a4adbfcea9fd9860ab83d43734dc5158d3a884
Reviewed-on: https://skia-review.googlesource.com/8220
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2017-02-08 20:21:18 +00:00
Hal Canary
529bcd6db7 Revert "Revert "SkScalar: delete code that doesn't compile.""
This reverts commit 8233fc82b0.

Change-Id: Ia32ccdb3b385ed28e1b41e553c7d80cf803522cc
Reviewed-on: https://skia-review.googlesource.com/7899
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-02-02 15:43:08 +00:00
Leon Scroggins
8233fc82b0 Revert "SkScalar: delete code thqat doesn't compile."
This reverts commit 565da18f6e.

Reason for revert:  breaking android roll:

https://googleplex-android-review.git.corp.google.com/#/c/1853481/-1..1

Some code in Android references SK_SCALAR_IS_FLOAT:
https://cs.corp.google.com/android/frameworks/base/core/jni/android/graphics/Interpolator.cpp?q=frameworks/base/core/jni/android/graphics/Interpolator.cpp&sq=package:android&l=30

Original change's description:
> SkScalar: delete code thqat doesn't compile.
> 
> Change-Id: I8a5c404d6151fca79af5c5a98d4b44924c0ade52
> Reviewed-on: https://skia-review.googlesource.com/7882
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Hal Canary <halcanary@google.com>
> 

TBR=halcanary@google.com,reed@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I4df06c4593abaa3ac3877b270a41aec7a9c3fc8f
Reviewed-on: https://skia-review.googlesource.com/7888
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2017-02-02 13:12:36 +00:00
Hal Canary
565da18f6e SkScalar: delete code thqat doesn't compile.
Change-Id: I8a5c404d6151fca79af5c5a98d4b44924c0ade52
Reviewed-on: https://skia-review.googlesource.com/7882
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-02-02 12:21:33 +00:00
Brian Salomon
958fbc460a Make SkShadowUtils tessellations ref counted in preparation for caching them.
Change-Id: I60133fcc4101a27bcc3e7ad38e7348ad9147b8a9
Reviewed-on: https://skia-review.googlesource.com/7784
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-01-31 14:42:29 +00:00
Robert Phillips
26caf898f1 Add utilities to create GrSurfaceProxy & GrSurfaceContext from backend descs
Change-Id: Iff2278de8ddd6c0dff74e5cf1996702bad31217b
Reviewed-on: https://skia-review.googlesource.com/7647
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-01-27 17:00:38 +00:00
Robert Phillips
757914d26b Switch GrConfigConversionEffect over to taking GrTextureProxies
Change-Id: Ic8be773e210e1ac05dcb9aad6c89dcd63e9e4ba2
Reviewed-on: https://skia-review.googlesource.com/7521
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-01-25 21:23:28 +00:00
Robert Phillips
d46697ac36 Use GrSurfaceContext::read/write-Pixels more
Change-Id: I04bcaf91aa7a43e0563e332c1fe2836d762a04d4
Reviewed-on: https://skia-review.googlesource.com/7520
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-01-25 17:53:10 +00:00
Herb Derby
5d72f7deb1 Remove SkTDict and calls from SkView.
R=reed@google.com

Change-Id: Iebfddf752a2ac210a3f5c69de8decd06d0c35617
Reviewed-on: https://skia-review.googlesource.com/7436
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2017-01-24 17:24:50 +00:00
Herb Derby
2a0daee1af Update SkTDict to use SkArenaAlloc.
Change-Id: I7ac33faa59bcad25b0580193af965a8525eb18e7
Reviewed-on: https://skia-review.googlesource.com/7360
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-01-23 19:07:01 +00:00
Brian Salomon
92ce594685 Add class GrProcessorSet which represents color and coverage FPs and a XPFactory.
Eventually ops can use this to hold their ops and create GrPipelines at flush time.

For now it is used by GrPipelineBuilder.

Change-Id: I0db3892032f2d07238e4c847a790678b3aab456f
Reviewed-on: https://skia-review.googlesource.com/7132
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-01-18 16:48:41 +00:00
Jim Van Verth
2103cf0ff0 Split ShadowMaskFilter into separate ambient and spot mask filters
This does not change the public API.

BUG=skia:6119

Change-Id: Ibdcd2f8611bc2eec332d8a65e5d51246b89a0a90
Reviewed-on: https://skia-review.googlesource.com/7083
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-01-16 18:40:59 +00:00
Herb Derby
4fa20cea81 Fix syntax error for adjusting old stdc++ headers.
Change-Id: Ibc99ae943b275b770e8767b80400b8e1520e70a5
Reviewed-on: https://skia-review.googlesource.com/7035
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2017-01-13 21:26:03 +00:00
Herb Derby
0497f088bb Introduce SkArenaAlloc - should be fast for POD types and RAII for types with dtors.
- Implementation.
- Use in SkLinearPipeline.

TBR=mtklein@google.com

Change-Id: Ie014184469b217132b0307b5a9ae40c0c60e5fc9
Reviewed-on: https://skia-review.googlesource.com/6921
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2017-01-13 18:45:19 +00:00
Hal Canary
5aedd6d5a3 cleanup after 95e3c05
Change-Id: Ifd194fd009196b8bee2dd83328bbe698586d72f4
Reviewed-on: https://skia-review.googlesource.com/6965
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-01-12 19:49:46 +00:00
Hal Canary
95e3c058ef SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h
* SkAutoFree moved to SkTemplates.h (now implmented with unique_ptr).

  * SkAutoMalloc and SkAutoSMalloc moved to SkAutoMalloc.h

  * "SkAutoFree X(sk_malloc_throw(N));" --> "SkAutoMalloc X(N);"

Revert "Revert 'SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h'"
This reverts commit c456b73fef.

Change-Id: Ie2c1a17c20134b8ceab85a68b3ae3e61c24fbaab
Reviewed-on: https://skia-review.googlesource.com/6886
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-01-11 18:55:34 +00:00
Kevin Lubick
c456b73fef Revert "SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h"
This reverts commit a5494f1170.

Reason for revert: Broke Google3

Original change's description:
> SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h
> 
>   * SkAutoFree moved to SkTemplates.h (now implmented with unique_ptr).
> 
>   * SkAutoMalloc and SkAutoSMalloc moved to SkAutoMalloc.h
> 
>   * "SkAutoFree X(sk_malloc_throw(N));" --> "SkAutoMalloc X(N);"
> 
> Change-Id: Idacd86ca09e22bf092422228599ae0d9bedded88
> Reviewed-on: https://skia-review.googlesource.com/4543
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Hal Canary <halcanary@google.com>
> 

TBR=halcanary@google.com,bungeman@google.com,reed@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: Ie8bd176121c3ee83c110d66c0d0ac65e09bfc9c5
Reviewed-on: https://skia-review.googlesource.com/6884
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2017-01-11 17:22:12 +00:00
Hal Canary
a5494f1170 SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h
* SkAutoFree moved to SkTemplates.h (now implmented with unique_ptr).

  * SkAutoMalloc and SkAutoSMalloc moved to SkAutoMalloc.h

  * "SkAutoFree X(sk_malloc_throw(N));" --> "SkAutoMalloc X(N);"

Change-Id: Idacd86ca09e22bf092422228599ae0d9bedded88
Reviewed-on: https://skia-review.googlesource.com/4543
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-01-11 15:36:45 +00:00
Brian Osman
986563bcff Add Gray8 pixel config
This is still just linear (non-sRGB), but adding sRGB will
be the next step. I've verified that this is really making
R8 textures when uploading Gray8 bitmaps. Tests pass, and
the all_bitmap_configs GM still renders correctly (unlike
when we just mapped Gray8 to Alpha8).

This adds another pixel config, which could grow our cache
footprint, but the benefits of not using 4bpp for 1bpp data
should outweigh that?

Re-land of https://skia-review.googlesource.com/c/6817/,
with fixes for Vulkan.

BUG=skia:6110

Change-Id: Ia763c276808be28027ed0005ee4b88637306583f
Reviewed-on: https://skia-review.googlesource.com/6839
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-01-10 20:37:09 +00:00
Brian Osman
4641d7d055 Revert "Add Gray8 pixel config"
This reverts commit f2956459f7.

Reason for revert: GM and image failures on some bots (rendering red, not gray).

Original change's description:
> Add Gray8 pixel config
> 
> This is still just linear (non-sRGB), but adding sRGB will
> be the next step. I've verified that this is really making
> R8 textures when uploading Gray8 bitmaps. Tests pass, and
> the all_bitmap_configs GM still renders correctly (unlike
> when we just mapped Gray8 to Alpha8).
> 
> This adds another pixel config, which could grow our cache
> footprint, but the benefits of not using 4bpp for 1bpp data
> should outweigh that?
> 
> BUG=skia:6110
> 
> Change-Id: I4fc4c2479fc25f1d278e174a9bb5b542a0cb184c
> Reviewed-on: https://skia-review.googlesource.com/6817
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> 

TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com,reviews@skia.org
BUG=skia:6110
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I95a4fc0450a569d5791f6bceb7fae61c7e5eba61
Reviewed-on: https://skia-review.googlesource.com/6838
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-01-10 18:47:38 +00:00
Brian Osman
f2956459f7 Add Gray8 pixel config
This is still just linear (non-sRGB), but adding sRGB will
be the next step. I've verified that this is really making
R8 textures when uploading Gray8 bitmaps. Tests pass, and
the all_bitmap_configs GM still renders correctly (unlike
when we just mapped Gray8 to Alpha8).

This adds another pixel config, which could grow our cache
footprint, but the benefits of not using 4bpp for 1bpp data
should outweigh that?

BUG=skia:6110

Change-Id: I4fc4c2479fc25f1d278e174a9bb5b542a0cb184c
Reviewed-on: https://skia-review.googlesource.com/6817
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-01-10 16:20:03 +00:00
Brian Salomon
19f0ed5b83 Purge clip masks when they are no longer findable.
This improves memory usage when the content contains frequently changing clips implemented as masks.

BUG=chromium:676459

Change-Id: I06ea5f9fe1cff9564ea136bad9fe97f6ecd77ad9
Reviewed-on: https://skia-review.googlesource.com/6629
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-01-06 19:42:08 +00:00
Brian Salomon
69868af684 Remove render target unique ID virtual from GrOp.
GrRenderTargetOpList now stores the IDs along side each op.

This should put us closer to using proxy IDs and not forcing early render target instantiation as many comments point towards.

Change-Id: I1ee82b01a0818a80d2bcac39fdf3a4ee7dccecc9
Reviewed-on: https://skia-review.googlesource.com/6403
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2016-12-22 21:10:48 +00:00
Brian Salomon
42ad83ac19 Rename batch->op in GrAuditTrail.
Change-Id: I68670e5ceb06716e9928ee58485d63e157c7aca7
Reviewed-on: https://skia-review.googlesource.com/6345
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2016-12-20 21:50:09 +00:00
Lee Salzman
ee1c73fc1b tweak SkOnce.h header to work around issues with std::atomic::compare_exchange_strong
BUG=skia:

Change-Id: Id29c47cb4bec6a6d70d6514d18fa4ab9bd31b1e2
Reviewed-on: https://skia-review.googlesource.com/6200
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2016-12-16 22:21:27 +00:00
Mike Klein
6b00a07d4f simplify SkTHash* move support
Don't know why I thought this had to be so complicated before.

BUG=skia:6053

Change-Id: Ie714fed1cb47e9add166d4227d3d31f95eba2411
Reviewed-on: https://skia-review.googlesource.com/6121
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2016-12-15 21:31:26 +00:00
Robert Phillips
e2f7d1899d Add a deferred copy surface (take 3)
This CL forces all GrSurface copies to go through a GrSurfaceContext (rather than GrContext).

There is a bit of goofiness going on here until read/writePixels is also consolidated in GrSurfaceContext and a proxy-backed SkImage/SkSurface is added.

This is a reland of https://skia-review.googlesource.com/c/5773/ (Add a deferred copy surface)

Change-Id: Ib8fd96d0569274ef781366eb900ed8ee839ae9bd
Reviewed-on: https://skia-review.googlesource.com/6109
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2016-12-15 15:07:39 +00:00
Herb Derby
acef51fdd8 Remove tombstones from SkTHash.
* Switch to linear probing - this allows delete to rearrange elements to fill in empty slots
* NULL -> nullptr


Change-Id: I741c2f3bb2734bf638d0c0a78c6cc549f563a5d9
Reviewed-on: https://skia-review.googlesource.com/5980
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2016-12-14 20:07:15 +00:00
Robert Phillips
d316e77c1e Revert "Add a deferred copy surface (take 2)"
This reverts commit 398487a850.

Reason for revert: See if this is causing the roll failure

Original change's description:
> Add a deferred copy surface (take 2)
> 
> This CL forces all GrSurface copies to go through a GrSurfaceContext (rather than GrContext).
> 
> There is a bit of goofiness going on here until read/writePixels is also consolidated in GrSurfaceContext and a proxy-backed SkImage/SkSurface is added.
> 
> This is a reland of https://skia-review.googlesource.com/c/5773/ (Add a deferred copy surface)
> 
> Change-Id: Ide560f569aede5e622420dc2f30eef76357d69f4
> Reviewed-on: https://skia-review.googlesource.com/5939
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> 

TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I1ef40f0d5fb0bca62031f94f10eb18acd753e913
Reviewed-on: https://skia-review.googlesource.com/6024
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2016-12-14 12:05:06 +00:00
Robert Phillips
398487a850 Add a deferred copy surface (take 2)
This CL forces all GrSurface copies to go through a GrSurfaceContext (rather than GrContext).

There is a bit of goofiness going on here until read/writePixels is also consolidated in GrSurfaceContext and a proxy-backed SkImage/SkSurface is added.

This is a reland of https://skia-review.googlesource.com/c/5773/ (Add a deferred copy surface)

Change-Id: Ide560f569aede5e622420dc2f30eef76357d69f4
Reviewed-on: https://skia-review.googlesource.com/5939
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2016-12-13 22:01:58 +00:00
Robert Phillips
293d696fcf Revert "Add a deferred copy surface"
This reverts commit 4431de6af9.

Reason for revert: ANGLE errors (at the very least)

Original change's description:
> Add a deferred copy surface
> 
> This CL forces all GrSurface copies to go through a GrSurfaceContext (rather than GrContext).
> 
> There is a bit of goofiness going on here until read/writePixels is also consolidated in GrSurfaceContext and a proxy-backed SkImage/SkSurface is added.
> 
> Change-Id: Iab1867668d8146a766201158a251b9174438ee2b
> Reviewed-on: https://skia-review.googlesource.com/5773
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> 

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

Change-Id: I61408d9e306b9b1ab32f93ab086e95184e12857f
Reviewed-on: https://skia-review.googlesource.com/5938
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2016-12-13 18:48:20 +00:00
Mike Klein
db402cab8b add move semantics to SkTHash*
The more I look at std::unordered_map and co., the less I like them.
I think we might want to bet on SkTHash*.

As a simple first improvement, add move support.
Next comes shrinking, and then I'll start moving over SkTDynamicHash users.

BUG=skia:6053

Change-Id: Ifdb5d713aab66434ca271c7f18a0cbbb0720099c
Reviewed-on: https://skia-review.googlesource.com/5943
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2016-12-13 18:18:47 +00:00
Robert Phillips
4431de6af9 Add a deferred copy surface
This CL forces all GrSurface copies to go through a GrSurfaceContext (rather than GrContext).

There is a bit of goofiness going on here until read/writePixels is also consolidated in GrSurfaceContext and a proxy-backed SkImage/SkSurface is added.

Change-Id: Iab1867668d8146a766201158a251b9174438ee2b
Reviewed-on: https://skia-review.googlesource.com/5773
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2016-12-13 17:57:13 +00:00
Mike Reed
ebfce6d9b4 change SkClipOp to a class enum
BUG=skia:

Change-Id: I25dbe6d6b8666a2a0a7be7bdd2ae0b067868d14e
Reviewed-on: https://skia-review.googlesource.com/5718
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2016-12-12 15:38:31 +00:00
Robert Phillips
784b7bf493 Different approach to fixing gpu blurs on platforms that "useDrawInsteadOfClear"
This CL reverts https://skia-review.googlesource.com/c/5148/ (Fix gpu blurring on platforms that "useDrawInsteadOfClear") (all the worstCaseWidth/Height stuff) and adds a new GrRenderTargetContext entry point (absClear) to specify clears that can't be discarded or altered.

BUG=skia:

Change-Id: I18b1373ecf4a153ca8c0f290ab8b1d00770426da
Reviewed-on: https://skia-review.googlesource.com/5484
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2016-12-09 19:29:38 +00:00
Mike Reed
c1f7774e8d Revert[2] "remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS"
This reverts commit a129dfef2a.

BUG=skia:

Change-Id: I717de6e5fcd4516aa684b014b1414b0f82ac2b91
Reviewed-on: https://skia-review.googlesource.com/5722
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2016-12-09 14:33:41 +00:00
Mike Reed
a129dfef2a Revert "remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS"
This reverts commit 8e7432b7f9.

Reason for revert: <INSERT REASONING HERE>

external/skia/bench/../tools/android/SkAndroidSDKCanvas.h:103:36: error: C++ requires a type specifier for all declarations
    void onClipRect(const SkRect&, ClipOp, ClipEdgeStyle) override;

Original change's description:
> remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS
> 
> 
> switch over to SkClipOps now that SK_SUPPORT_LEGACY_CLIP_REGIONOPS is gone
> 
> BUG=skia:
> 
> Change-Id: Ifdc8b3746d508348a40cc009a4e529a1cb3c405d
> Reviewed-on: https://skia-review.googlesource.com/5714
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> 

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

Change-Id: If26ea91d7464615e43c1d3d2f726e337ff56b55c
Reviewed-on: https://skia-review.googlesource.com/5721
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2016-12-09 13:14:41 +00:00
Mike Reed
8e7432b7f9 remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS
switch over to SkClipOps now that SK_SUPPORT_LEGACY_CLIP_REGIONOPS is gone

BUG=skia:

Change-Id: Ifdc8b3746d508348a40cc009a4e529a1cb3c405d
Reviewed-on: https://skia-review.googlesource.com/5714
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2016-12-08 21:45:27 +00:00
Brian Salomon
25a880960a Rename GrBatch to GrOp
Change-Id: I27b6324f8040899fafeda23ca524bc54a4dbf090
Reviewed-on: https://skia-review.googlesource.com/5392
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2016-12-01 15:12:53 +00:00
Brian Salomon
94efbf51f5 Merge GrGLSLCaps into GrShaderCaps
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5121

Change-Id: If8d13638f80f42161cbc766a2666c5789e5772c8
Reviewed-on: https://skia-review.googlesource.com/5121
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2016-11-29 19:32:31 +00:00
Mike Klein
e9f78b41c6 Guard against buggy ucrt\math.h.
BUG=666707

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5089

CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Change-Id: I3bebfdf635d541d92fb84236f0f6fae2da39d691
Reviewed-on: https://skia-review.googlesource.com/5089
Reviewed-by: Bruce Dawson <brucedawson@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2016-11-28 15:40:23 +00:00
Robert Phillips
93f1633abc Fix gpu blurring on platforms that "useDrawInsteadOfClear"
Platforms that "useDrawInsteadOfClear" take a different path in
GrRenderTargetContext::internalClear. The different path involves
a lot of comparisons of the drawn rect with the bounds of the RenderTarget. Since the RenderTargets are now deferred (and the instantiated version might be larger than the proxied size) case must be taken in prematurely optimizing away clears and draws.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5148

TBR=bsalomon@google.com

Change-Id: If63b6393fb66328175bc92de211e7242e903f25e
Reviewed-on: https://skia-review.googlesource.com/5148
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2016-11-25 21:36:00 +00:00
Brian Osman
45580d3e30 Added GrSurfaceContext and GrTextureContext
This lets copy-to-texture to be treated like copy-to-rt.
To match current behavior, though, copies to texture are
still executed immediately (forcing a flush).

Once MDB is enabled, copies to texture will be deferred.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5093

Change-Id: Icc0ce5435507a5f0a237c22eedef879824952367
Reviewed-on: https://skia-review.googlesource.com/5093
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2016-11-23 15:52:27 +00:00
robertphillips
1125a030c7 Add IORef capability to GrSurfaceProxy objects - take 2
Re-landing of https://skia-review.googlesource.com/c/4734/ (Add IORef capability to GrSurfaceProxy objects) with fixes for:
 platforms that don't support discards.
 memory leak due to copying over of GrSurfaceProxy's creation ref to instantiated GrSurface in instantiate()

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4827
BUG=skia:

Change-Id: If0b695d5cafc5ef3fdd251c38262849d09e5d27f
Review-Url: https://codereview.chromium.org/2502923003
2016-11-16 11:17:17 -08:00
Robert Phillips
f27bab207a Revert "Add IORef capability to GrSurfaceProxy objects"
This reverts commit 286b96f876.

Reason for revert: 

Failure on Mac Mini:

FAILURE: ../../../tests/ProxyRefTest.cpp:59	proxy->getPendingWriteCnt_TestOnly() == expectedNumWrites

../../../tests/ProxyRefTest.cpp:64: fatal error: "assert(proxy->getPendingWriteCnt_TestOnly() == expectedNumWrites)"


Original change's description:
> Add IORef capability to GrSurfaceProxy objects
> 
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4734
> 
> Change-Id: If10fbe555e9fa3331bfa01065028e1afe82adb78
> Reviewed-on: https://skia-review.googlesource.com/4734
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> 

TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I5e1c201e027d4e9687b01f28a418b1884d3f9ece
Reviewed-on: https://skia-review.googlesource.com/4776
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2016-11-14 19:29:39 +00:00
Robert Phillips
286b96f876 Add IORef capability to GrSurfaceProxy objects
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4734

Change-Id: If10fbe555e9fa3331bfa01065028e1afe82adb78
Reviewed-on: https://skia-review.googlesource.com/4734
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2016-11-14 19:04:47 +00:00
Robert Phillips
294870ff11 Add explicit UniqueID classes for GrGpuResource & GrSurfaceProxy
This sets the stage for using the Proxy's/RenderTargetContext's ID above the flush and the RenderTarget's/GrGpuResource's below the flush.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4650

Change-Id: I9f1e6b00c02a0691d90b58c49e1d8c60684884c1
Reviewed-on: https://skia-review.googlesource.com/4650
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2016-11-11 18:24:56 +00:00
Robert Phillips
ec2249fc73 Move GrRenderTargetPriv::maxWindowRectangles to GrRenderTargetContextPriv & GrRenderTargetProxy
This removes a reason to call accessRenderTarget on the GrRenderTargetContext

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4583

Change-Id: I6e8a53ffd5c1fea80f542b70e05744e2991f70f8
Reviewed-on: https://skia-review.googlesource.com/4583
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2016-11-09 15:10:37 +00:00
Robert Phillips
3743013f75 Consolidate GrSurfaceProxy Make methods
I think GrSurfaceDesc is still the most compact way to communicate the deferred GrSurface's settings to the Proxy but this CL, at least, reduces where it is used.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4559

Change-Id: Ica599c28a5aef1ed4094f47a4ac119e2d204d652
Reviewed-on: https://skia-review.googlesource.com/4559
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2016-11-09 12:20:50 +00:00
Robert Phillips
eaa862569d Revert "Revert "Add GrRenderTargetContext instantiate & asTextureProxy""
This reverts commit 7d7d7d1946.

Reason for revert: Reverting this to see if it really was crashing on SVGs or if that was cross talk.

Original change's description:
> Revert "Add GrRenderTargetContext instantiate & asTextureProxy"
> 
> This reverts commit 9113edfff8.
> 
> Reason for revert: Looks to be causing EXCEPTION_ACCESS_VIOLATION:
> 
> https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Win-MSVC-NUC-GPU-IntelIris6100-x86_64-Debug/builds/121/steps/test_skia%20on%20Windows/logs/stdio
> https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Win-MSVC-GCE-CPU-AVX2-x86-Debug/builds/2384/steps/test_skia%20on%20Windows-2008ServerR2-SP1/logs/stdio
> https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Win-MSVC-ShuttleC-GPU-iHD530-x86_64-Debug/builds/785/steps/test_skia%20on%20Windows/logs/stdio
> 
> Original change's description:
> > Add GrRenderTargetContext instantiate & asTextureProxy
> > 
> > This CL also centralizes the instantiation code in GrSurfaceProxy and adds a test.
> > 
> > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4494
> > 
> > Change-Id: I0081d9a216dc0af293179f23bcb88acf6a822324
> > Reviewed-on: https://skia-review.googlesource.com/4494
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Robert Phillips <robertphillips@google.com>
> > 
> 
> TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> 
> Change-Id: I225ce7867ebd445067e5ea55ebbfd587f7fe782a
> Reviewed-on: https://skia-review.googlesource.com/4528
> Commit-Queue: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> 

TBR=bsalomon@google.com,robertphillips@google.com,scroggo@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: Ifc3b9ac343009a3808f5f47500eef50df438e3d9
Reviewed-on: https://skia-review.googlesource.com/4537
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2016-11-08 13:49:49 +00:00
Leon Scroggins
7d7d7d1946 Revert "Add GrRenderTargetContext instantiate & asTextureProxy"
This reverts commit 9113edfff8.

Reason for revert: Looks to be causing EXCEPTION_ACCESS_VIOLATION:

https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Win-MSVC-NUC-GPU-IntelIris6100-x86_64-Debug/builds/121/steps/test_skia%20on%20Windows/logs/stdio
https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Win-MSVC-GCE-CPU-AVX2-x86-Debug/builds/2384/steps/test_skia%20on%20Windows-2008ServerR2-SP1/logs/stdio
https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Win-MSVC-ShuttleC-GPU-iHD530-x86_64-Debug/builds/785/steps/test_skia%20on%20Windows/logs/stdio

Original change's description:
> Add GrRenderTargetContext instantiate & asTextureProxy
> 
> This CL also centralizes the instantiation code in GrSurfaceProxy and adds a test.
> 
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4494
> 
> Change-Id: I0081d9a216dc0af293179f23bcb88acf6a822324
> Reviewed-on: https://skia-review.googlesource.com/4494
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> 

TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I225ce7867ebd445067e5ea55ebbfd587f7fe782a
Reviewed-on: https://skia-review.googlesource.com/4528
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2016-11-07 21:26:46 +00:00
Robert Phillips
9113edfff8 Add GrRenderTargetContext instantiate & asTextureProxy
This CL also centralizes the instantiation code in GrSurfaceProxy and adds a test.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4494

Change-Id: I0081d9a216dc0af293179f23bcb88acf6a822324
Reviewed-on: https://skia-review.googlesource.com/4494
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2016-11-07 20:28:13 +00:00
Ben Wagner
260d9b3152 Move SkChunkAlloc.h to include/private.
This class does not appear to have any external users, and Skia probably
does not want anyone depending on it. It also clutters up include/core
with an 'uninteresting' utility class.

Change-Id: I7de9468500ecffd0b722f222932e4f8b6637925b
Reviewed-on: https://skia-review.googlesource.com/4522
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2016-11-07 20:16:56 +00:00
Robert Phillips
84a812061f Add GrTextureRenderTargetProxy and support switching between RT & Tex Proxies
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4427

Change-Id: Ie7662299953592f564bb27a4df4ea101f743403e
Reviewed-on: https://skia-review.googlesource.com/4427
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2016-11-07 15:56:19 +00:00
Ben Wagner
145dbcd165 Remove SkAutoTDelete.
Replace with std::unique_ptr.

Change-Id: I5806cfbb30515fcb20e5e66ce13fb5f3b8728176
Reviewed-on: https://skia-review.googlesource.com/4381
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2016-11-03 19:03:40 +00:00
Robert Phillips
29e52f13f6 Centralize computation of GrRenderTarget & GrTexture VRAM consumption
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4310

Change-Id: I676749ecf1e489f825799b619a15a45fc7dcd219
Reviewed-on: https://skia-review.googlesource.com/4310
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2016-11-03 16:44:50 +00:00
Ben Wagner
7ecc59610d Remove SkAutoTDeleteArray
This class is already just an alias for std::unique_ptr<T[]>, so replace
all uses with that and delete the class.

CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-ASAN-Trybot,Test-Ubuntu-Clang-Golo-GPU-GT610-x86_64-Debug-ASAN-Trybot

Change-Id: I40668d398356a22da071ee791666c7f728b59266
Reviewed-on: https://skia-review.googlesource.com/4362
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2016-11-02 21:30:38 +00:00
Robert Phillips
abacf0978f Update ProxyTests
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4306

Change-Id: I0753047eeda71a22b6126f932fc14dd242c5a2e7
Reviewed-on: https://skia-review.googlesource.com/4306
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2016-11-02 16:06:25 +00:00
Robert Phillips
8bc06d07f5 Back SkSpecialImage_Gpu with a GrTextureProxy
This is split out of https://codereview.chromium.org/2215323003/ (Start using RenderTargetProxy (omnibus))

The addition of the gpuMemorySize methods is for the SkSpecialImage cache.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4227

Change-Id: Ia9b9d42fb2a0caf61bbfa3ebcc84308c56f541fc
Reviewed-on: https://skia-review.googlesource.com/4227
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2016-11-02 15:32:04 +00:00
Mike Reed
7d954ad797 remove xfermode from public api
BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4020

CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Change-Id: I19cd056f2af778f10e8c6c2b7b2735593b43dbac
Reviewed-on: https://skia-review.googlesource.com/4020
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2016-10-28 20:06:17 +00:00
Robert Phillips
c7635fa374 Make GrDrawContext be GrRenderTargetProxy-backed
This is split out of https://codereview.chromium.org/2215323003/ (Start using RenderTargetProxy (omnibus))

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3841

CQ_INCLUDE_TRYBOTS=master.client.skia.android:Test-Android-Clang-Nexus5-GPU-Adreno330-arm-Debug-GN_Android-Trybot

Change-Id: I1a47f19ed1ac0c249e6ccac8db74095d7f456db4
Reviewed-on: https://skia-review.googlesource.com/3841
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2016-10-28 18:35:06 +00:00
Brian Osman
1105224f97 Rename GrDrawContext to GrRenderTargetContext
This is in preparation for GrTextureContext and GrSurfaceContext

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4030

Change-Id: Ie58c93052e68f3f1f5fe8d15d63760de274a6fbd
Reviewed-on: https://skia-review.googlesource.com/4030
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2016-10-27 19:14:09 +00:00
bungeman
6bd5284415 Remove SkAutoTUnref and SkAutoTDelete from public includes.
This also makes the required changed to src, tests, and tools. The few
public APIs modified by this change appear to be unused outside of Skia.

Removing these from the public API makes it easier to ensure users are
no longer using them.

This also updates GrGpu::wrapBackendXXX and the
::onWrapBackendXXX methods to clarify ownership.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2448593002

Review-Url: https://codereview.chromium.org/2448593002
2016-10-27 09:30:08 -07:00
Robert Phillips
f2361d2d93 Add GrOpList and rename GrDrawTarget to GrRenderTargetOpList
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3910

Change-Id: I026aa26ecc61a0d002e98892dca728536259e8b1
Reviewed-on: https://skia-review.googlesource.com/3910
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2016-10-26 00:48:37 +00:00
Brian Osman
7c2114fc2f Cache GrColorSpaceXforms
Even with a modest cache, we're going to get nearly 100% hit rate
for typical usage scenarios. I'm hoping to avoid the special case
caching of sRGB -> destination, and just rely on the more general
mechanism.

Yes, this is yet-another cache class. I wanted to use one of many
that are laying around, but couldn't find a good fit. On the plus
side, it's not much code.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3726

Change-Id: I943be5c99f0d691a87ffe8c5bc3067a8eb491fc2
Reviewed-on: https://skia-review.googlesource.com/3726
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2016-10-20 20:47:33 +00:00
liyuqian
3f490cc642 Make SkFixedRound/Ceil/FloorToFixed as inline func
The macros that we were using will return unsigned int32 instead of
signed int32 because of the last 0xFFFF0000 mask. That may bring
problems if we right shift that result.

Special thanks to mtklein@google.com for helping me find out this issue.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2433233003

Review-Url: https://chromiumcodereview.appspot.com/2433233003
2016-10-20 11:23:10 -07:00