Uninstantiated: a state of not being instantiated.
Deinstantiate: transition from instantiated to uninstantiated state.
Change-Id: Id7b6b295267674a9915f95105d73fabfcc3555de
Reviewed-on: https://skia-review.googlesource.com/c/175586
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Recent work to dynamically switch the CPU type of the color attribute
exposed this problem - we were ignoring the attribute types, and getting
cache hits on incorrect GrProgram objects with stale layout information.
This fixes GMs in configs that may use F16 colors (eg glenarrow).
Bug: skia:
Change-Id: Ic87c47601c26e53c2173713a6cf14d209af8e246
Reviewed-on: https://skia-review.googlesource.com/c/175243
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This is a reland of 1b04794234
Original change's description:
> Bypass interval tracking and assignment of read-only texures in GrResourceAllocator.
>
> Bug: skia:8509
>
> Change-Id: Idecf3a5335945c9ff21f27cd3f7887125214d02d
> Reviewed-on: https://skia-review.googlesource.com/c/174592
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
Bug: skia:8509
Change-Id: I26eaf9606e2b9c238e40a230a8eda15e97400515
Reviewed-on: https://skia-review.googlesource.com/c/175251
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This reverts commit 10273c1d5f.
Reason for revert: bad gms
Original change's description:
> Use unnormalized coords all the way through with GL_TEXTURE_RECTANGLE textures.
>
> We used to unnormalize them in the shader via SkSL.
>
> This allows us to support GL_TEXTURE_RECTANGLE without having textureSize()
> available in GLSL.
>
> Change-Id: Ibe63a302228811933ef000251db4cad9aaf4f2ea
> Reviewed-on: https://skia-review.googlesource.com/c/174068
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,brianosman@google.com
Change-Id: I9bf38e1040578becba28ac8cccd81e2af2844278
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/175252
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: skia:7903
Change-Id: I69b65fc1cfcc2cc5045bb3b75395f9a256ade278
Reviewed-on: https://skia-review.googlesource.com/c/172979
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Read only textures and proxies fail writePixels, as copy dsts, and mip
regeneration.
Bug: skia:8509
Change-Id: Iaa0b473cc9a9930fde3ef0e91373d5040650de35
Reviewed-on: https://skia-review.googlesource.com/c/174316
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
We used to unnormalize them in the shader via SkSL.
This allows us to support GL_TEXTURE_RECTANGLE without having textureSize()
available in GLSL.
Change-Id: Ibe63a302228811933ef000251db4cad9aaf4f2ea
Reviewed-on: https://skia-review.googlesource.com/c/174068
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Change-Id: I4960b1cd055daf44637e95825f82cb7fe2ce134a
Reviewed-on: https://skia-review.googlesource.com/c/174285
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This turns out to be mostly deleting dead debugging code.
Change-Id: I4969ea380e6125e8b557d430c6720edc0a337a79
Reviewed-on: https://skia-review.googlesource.com/c/174284
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Change-Id: Ia400db2b73a8061668e62f8e961538a060b216a1
Reviewed-on: https://skia-review.googlesource.com/c/174282
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Change-Id: I6eb4469df0315283f96631ff6023170fa80aaa8a
Reviewed-on: https://skia-review.googlesource.com/c/174281
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Whatever nonsense SkPicture::uniqueID() was doing, it doesn't
need to do it. It can just get its unique ID normally.
I've ported SkEventTracer in the straightforward way.
Change-Id: I103e7e05258ad49e1e3f333fc907f039cef3f8c9
Reviewed-on: https://skia-review.googlesource.com/c/174280
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
- Replace sk_memory_order with std::memory_order.
- Remove SkAtomic<T>.
SkPath was the only user of SkAtomic<T>, for its fConvexity and
fFirstDirection fields. I've replaced them with std::atomic types, and
funneled access to them through methods that enforce the relaxed memory
order like SkAtomic<T> did.
For fConvexity, we can use the exisiting setConvexity() and
getConvexityOrUnknown() methods, adding a private const setConvexity()
to mutate convexity from const methods. For fFirstDirection I've added
private setFirstDirection() and getFirstDirection() methods.
Removing SkAtomic<T> means SkAtomics.h no longer needs SkNoncopyable.h.
I've had to update a bunch of other headers that were depending on
transitive inclusion.
Change-Id: Ib238be71a121519db6e970a9a8955834e1298c87
Reviewed-on: https://skia-review.googlesource.com/c/174220
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
In theory, a convex shape is still convex if transformed by an affine
matrix. However, SkPath segments are specified using floats, and attributes
like collinearity can break under some transforms due to finite precision.
Computing convexity is non-trivial, so there is value in SkPath caching this
calculation. Convexity is useful, as both the CPU and GPU backends can draw
convex shapes faster than non-convex.
To balance these two (fragile float math and value of caching convexity),
this CL invalidates this cached state if the transform could change convexity.
In the general case, it is assumed that convexity could change. Special cases
where it is safe to keep the cached state after transform are:
- identity transform
- scale/translate transform if the path is known to be axis-aligned
All other combinations invalidate the cached state, forcing it to be
recomputed.
"axis-aligned" means the segments in the path are all axis-aligned, horizontal
or vertical (e.g. a rect or rrect)
Bug: 899689
Change-Id: I1381273eaff61d6b7134ae94b4f251c69991081a
Reviewed-on: https://skia-review.googlesource.com/c/173226
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
Change-Id: I4232d23e0c2dfe46695e948c46f2745c8e7e555c
Reviewed-on: https://skia-review.googlesource.com/c/172945
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This fixes a crash in skiaserve when running in GPU mode.
Remove GR_AUDIT_TRAIL_OP_RESULT_NEW. This macro doesn't do anything and
is non-trivial to know when to call if a new op gets chained.
Change-Id: Ic2a9c09e3d15541a566534654b2393cb740fa302
Reviewed-on: https://skia-review.googlesource.com/c/172864
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: skia:
Change-Id: I2d166ed6c1cb1c13a91526e2f0340623e0436003
Reviewed-on: https://skia-review.googlesource.com/c/171782
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Bug: skia:
Change-Id: Ie681369ef4b1d3d43c326da684afde9ce6d08486
Reviewed-on: https://skia-review.googlesource.com/c/171726
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
GrVertexColor stores either kind of color, and GrVertexWriter does the
right thing. SkColor4fPrepForDst helps to automate the conversion and
pinning. This ensures that colors are already pinned if the device has
no support for half-floats. This way, ops never need to worry about caps,
they can just check if all colors they're batching are normalized.
Bug: skia:
Change-Id: Ie0c15d3b16c6fc93a7f11d284029d77d482a6283
Reviewed-on: https://skia-review.googlesource.com/c/171725
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Used in upcoming changes to decide between byte and half-float
vertex attributes for Ops that store paint colors in vertices.
Bug: skia:
Change-Id: Idbcc801b15c1d99c604fc393cde18032ae5702c6
Reviewed-on: https://skia-review.googlesource.com/c/170262
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
This is going to be faster, and it's the last usage of GrColorMul
Bug: skia:
Change-Id: I2ecbed55ec401792f8d8f8ab9dc91a14182094b4
Reviewed-on: https://skia-review.googlesource.com/c/171520
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
They're only specialized up to SSE2 or NEON,
both of which are typical baseline builds now.
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: If2b2bbd5b002038c68c0064ee78d75911a33b988
Reviewed-on: https://skia-review.googlesource.com/c/170064
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This reverts commit 51b1c12bbc.
Reason for revert: reverting till flutter gets to 1.1 to fix build issues.
Original change's description:
> Have a GrBackendFormat be stored on gpu proxies.
>
> Bug: skia:
> Change-Id: Iaf1fb24ab29a61d44e5fa59a5e0867ed02dcda90
> Reviewed-on: https://skia-review.googlesource.com/c/168021
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>
TBR=egdaniel@google.com,bsalomon@google.com,brianosman@google.com
Change-Id: I574fdc084ef5994596c51fb0d60423b5dc01b885
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:903701 chromium:903756
Reviewed-on: https://skia-review.googlesource.com/c/169835
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Bug: skia:
Change-Id: Iaf1fb24ab29a61d44e5fa59a5e0867ed02dcda90
Reviewed-on: https://skia-review.googlesource.com/c/168021
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Change-Id: I9ba1caa4862bdf9ffc9c0e637bd69cce91fd8468
Reviewed-on: https://skia-review.googlesource.com/c/168740
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This is a reland of 166dbd3135
Since last attempt,
- update SkPath::Direction docs
- kIllegal is not an advanced blend mode
Original change's description:
> make enum santizer fatal
>
> This enum sanitizer checks that all the values of the enum we use fall
> within the range of the enumerated values.
>
> The main thing this helps point out is that the size of enum types in
> C++ need only be large enough to hold the largest declared value; larger
> values are undefined. In practice, most enums are implemented as ints
> for compatibility with C, so while this hasn't pointed out anything
> egregiously broken, the sanitizer has found a couple possibly dangerous
> situations in our codebase.
>
> For most types using values outside the enum range, we can just
> explicitly size them to int. This makes their de facto size de jure.
>
> But we need to actually make GrBlendEquation and GrBlendCoeff not store
> values outside their enumerated range. They're packed into bitfields
> that really can't represent those (negative) values. So for these I've
> added new kIllegal values to the enums, forcing us to deal with our
> once-silent illegal values a bit more explicitly.
>
> Change-Id: Ib617694cf1aaa83ae99289e9e760f49cb6393a2f
> Reviewed-on: https://skia-review.googlesource.com/c/168484
> Reviewed-by: Brian Osman <brianosman@google.com>
Cq-Include-Trybots: skia.primary:Housekeeper-PerCommit-Bookmaker,Test-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Debug-All-Android
Change-Id: Id93b80bbeae11872542c9b76715e3c3cb10609fd
Reviewed-on: https://skia-review.googlesource.com/c/168582
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This reverts commit 166dbd3135.
Reason for revert: illegal is not advanced, docs
Original change's description:
> make enum santizer fatal
>
> This enum sanitizer checks that all the values of the enum we use fall
> within the range of the enumerated values.
>
> The main thing this helps point out is that the size of enum types in
> C++ need only be large enough to hold the largest declared value; larger
> values are undefined. In practice, most enums are implemented as ints
> for compatibility with C, so while this hasn't pointed out anything
> egregiously broken, the sanitizer has found a couple possibly dangerous
> situations in our codebase.
>
> For most types using values outside the enum range, we can just
> explicitly size them to int. This makes their de facto size de jure.
>
> But we need to actually make GrBlendEquation and GrBlendCoeff not store
> values outside their enumerated range. They're packed into bitfields
> that really can't represent those (negative) values. So for these I've
> added new kIllegal values to the enums, forcing us to deal with our
> once-silent illegal values a bit more explicitly.
>
> Change-Id: Ib617694cf1aaa83ae99289e9e760f49cb6393a2f
> Reviewed-on: https://skia-review.googlesource.com/c/168484
> Reviewed-by: Brian Osman <brianosman@google.com>
TBR=mtklein@chromium.org,mtklein@google.com,brianosman@google.com
Change-Id: I691c08092340a6273e442c0f098b844f7d0363ba
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/168581
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This enum sanitizer checks that all the values of the enum we use fall
within the range of the enumerated values.
The main thing this helps point out is that the size of enum types in
C++ need only be large enough to hold the largest declared value; larger
values are undefined. In practice, most enums are implemented as ints
for compatibility with C, so while this hasn't pointed out anything
egregiously broken, the sanitizer has found a couple possibly dangerous
situations in our codebase.
For most types using values outside the enum range, we can just
explicitly size them to int. This makes their de facto size de jure.
But we need to actually make GrBlendEquation and GrBlendCoeff not store
values outside their enumerated range. They're packed into bitfields
that really can't represent those (negative) values. So for these I've
added new kIllegal values to the enums, forcing us to deal with our
once-silent illegal values a bit more explicitly.
Change-Id: Ib617694cf1aaa83ae99289e9e760f49cb6393a2f
Reviewed-on: https://skia-review.googlesource.com/c/168484
Reviewed-by: Brian Osman <brianosman@google.com>
Bug: skia:
Change-Id: I395395b1cd81a1d45ca779b2273015c8ed9fb882
Reviewed-on: https://skia-review.googlesource.com/c/168361
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
This reverts commit 5a4f2a341a.
Bug: skia:
Change-Id: I706009343dc1976311a88d57800a140efd776861
Reviewed-on: https://skia-review.googlesource.com/c/168363
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit 52065473ee.
Reason for revert: Typo messed up LCD blending
Original change's description:
> Use float colors for blend constant
>
> Bug: skia:
> Change-Id: Ie2a4b341a5e7762c3e8031fbd0f0d8b1ebae27f1
> Reviewed-on: https://skia-review.googlesource.com/c/168268
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>
TBR=egdaniel@google.com,mtklein@google.com,bsalomon@google.com,brianosman@google.com
Change-Id: Ieaad5724099e18727296ce312d728a1a9ed45c4b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/168362
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:
Change-Id: Ie2a4b341a5e7762c3e8031fbd0f0d8b1ebae27f1
Reviewed-on: https://skia-review.googlesource.com/c/168268
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Bug: skia:
Change-Id: I5386e27edbcf39233880d869841a6632ecb9416c
Reviewed-on: https://skia-review.googlesource.com/c/168261
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Bug: skia:
Change-Id: I942e46c2b680714cdd10f7393c6a4d206df645a8
Reviewed-on: https://skia-review.googlesource.com/c/167394
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
SkRefCntBase is an implementation detail of SkRefCnt, so let's not
mention it in SkContext_Compute.h. While I'm here, I notice SkNVRefCnt
would work fine too.
No one else calls internal_dispose_restore_refcnt_to_1(), so we can
inline it. While here, I notice it's resetting the ref count to 1 even
in release builds. I'm not sure if that is/can be optimized away, but
in any case I think we can wrap with #ifdef SK_DEBUG, if only to make it
clear that it's only there to support the assert in the destructor.
I've removed validate(). Most of the places it's called read pretty
weird, and I think suggest some sort of class-specific validation than
just checking that we're holding a ref. SkWeakRefCnt::validate() isn't
called anywhere.
There were few users of getRefCnt() outside SkRefCnt itself, so I
removed the rest and made it private.
I've added a few this-> to self calls while at it.
Change-Id: I98be06677a6e8b8e66f44cbb17d14e38b0f39d38
Reviewed-on: https://skia-review.googlesource.com/c/167160
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
- Mechanical replacement of GrColor4h (used throughout Ops) with
SkPMColor4f.
- API adaptation (to/FromGrColor -> to/From_BytesRGBA).
- Complete removal of FromFloats (source was already SkPMColor4f),
and toFloats (setting uniforms can directly access .vec()).
Bug: skia:
Change-Id: I37eece1fa7ed2545dc6843e840d4cc3c60f19747
Reviewed-on: https://skia-review.googlesource.com/c/166620
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
The Windows header definitions of NAN and INFINITY involve overflowing
math, making clang treat them as not being constexpr. Now they're
constexpr everywhere.
Bug: skia:
Change-Id: I84c05aae2952a152fed4eceb55cd2680d6fd5b05
Reviewed-on: https://skia-review.googlesource.com/c/166840
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This function was misleading because GrRenderTargetOpList::forwardCombine
can leave holes in the array which were still counted.
It would be harder to track this in op chaining redux.
Change-Id: Ib9619839012cb7dd2d0e4ccac31a231787f90f2d
Reviewed-on: https://skia-review.googlesource.com/c/166442
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This is a test CL to measure perf impact on the bots
Bug: skia:
Change-Id: I8aae0ac1373921d4d1b5f92e1f6b2318e66f0032
Reviewed-on: https://skia-review.googlesource.com/c/166283
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit 0fb1ee98cf.
Reason for revert: looks like this increased size by ~8K.
Original change's description:
> replace SkNVRefCnt with SkRefCnt
>
> SkNVRefCnt trades a small amount of code size (vtable) and runtime
> (vptr) memory usage for a larger amount of code size (templating). It
> was written back in a time when all we were really thinking about was
> runtime memory usage, so I'm curious to see where performance, code
> size, and memory usage all move if it's removed.
>
> Looking at the types I've changed here, my guess is that performance and
> memory usage will be basically unchanged, and that code size will drop a
> bit. Nothing else it's nicer to have only one ref-counting base class.
>
> Change-Id: I7d56a2b9e2b9fb000ff97792159ea1ff4f5e6f13
> Reviewed-on: https://skia-review.googlesource.com/c/166203
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>
TBR=mtklein@google.com,bsalomon@google.com,mtklein@chromium.org
Change-Id: Ibcfcc4b523c466a535bea5ffa30d0fe2574c5bd7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/166360
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>