aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
Commit message (Collapse)AuthorAge
* Port SkRefCnt.h to new SkAtomics.hGravatar mtklein2015-02-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds sk_memory_barrier(), implemented using sk_atomic_fetch_add() on an uninitialized variable. If that becomes a problem we can drop this to the porting layer, using std::atomic_thread_fence() / __atomic_thread_fence() / __sync_synchronize(). The big win is that ref() doesn't generate a memory barrier any more on ARM. This is an instance of SkSafeRef() in SkPaint(const SkPaint&) after this CL: 4d0: 684a ldr r2, [r1, #4] 4d2: 6018 str r0, [r3, #0] 4d4: b13a cbz r2, 4e6 <_ZN7SkPaintC1ERKS_+0x2e> 4d6: 1d10 adds r0, r2, #4 4d8: e850 4f00 ldrex r4, [r0] 4dc: 3401 adds r4, #1 4de: e840 4500 strex r5, r4, [r0] 4e2: 2d00 cmp r5, #0 4e4: d1f8 bne.n 4d8 <_ZN7SkPaintC1ERKS_+0x20> Here's the before, pretty much the same with two memory barriers surrounding the ref(): 4d8: 684a ldr r2, [r1, #4] 4da: 6018 str r0, [r3, #0] 4dc: b15a cbz r2, 4f6 <_ZN7SkPaintC1ERKS_+0x3e> 4de: 1d10 adds r0, r2, #4 4e0: f3bf 8f5f dmb sy 4e4: e850 4f00 ldrex r4, [r0] 4e8: 3401 adds r4, #1 4ea: e840 4500 strex r5, r4, [r0] 4ee: 2d00 cmp r5, #0 4f0: d1f8 bne.n 4e4 <_ZN7SkPaintC1ERKS_+0x2c> 4f2: f3bf 8f5f dmb sy The miscellaneous files in here are just fixups to explicitly include SkMutex.h, instead of leeching it off SkRefCnt.h. No public API changes. TBR=reed@google.com Build trybots seem hosed. NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/896803002
* patch from issue 886233004 at patchset 40001 ↵Gravatar mtklein2015-02-02
| | | | | | | | | | (http://crrev.com/886233004#ps40001) ... with changes proposed in the review. BUG=skia: Review URL: https://codereview.chromium.org/894013002
* make getContentKey() available in GrGpuResource public interfaceGravatar bsalomon2015-02-02
| | | | | | | | TBR=robertphillips@google.com Committed: https://skia.googlesource.com/skia/+/85ed2db092e75db41b711b9116a8d5b465fc2b0c Review URL: https://codereview.chromium.org/886313005
* Revert of make getContentKey() available in GrGpuResource public interface ↵Gravatar stephana2015-02-02
| | | | | | | | | | | | | | | | | | | | | | | (patchset #2 id:20001 of https://codereview.chromium.org/886313005/) Reason for revert: This causes in one case the linker and in the other the compiler to segfault. On Test-Ubuntu12-ShuttleA-GTX660-x86_64-Debug/Release Original issue's description: > make getContentKey() available in GrGpuResource public interface > > TBR=robertphillips@google.com > > Committed: https://skia.googlesource.com/skia/+/85ed2db092e75db41b711b9116a8d5b465fc2b0c TBR=robertphillips@google.com,bsalomon@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/864343005
* make getContentKey() available in GrGpuResource public interfaceGravatar bsalomon2015-02-02
| | | | | | TBR=robertphillips@google.com Review URL: https://codereview.chromium.org/886313005
* DM: wire up --leaks / -l againGravatar mtklein2015-02-02
| | | | | | | | | No public API changes. TBR=reed@google.com BUG=skia: Review URL: https://codereview.chromium.org/893043002
* Move npot resizing out of GrContext and simplify GrContext texture functions.Gravatar bsalomon2015-02-02
| | | | | | | | Committed: https://skia.googlesource.com/skia/+/8a8100349105c8c6de39fcb34e47679da7a67f54 Committed: https://skia.googlesource.com/skia/+/6c96672491b04cb782bce8fee778124df66524a0 Review URL: https://codereview.chromium.org/882223003
* Atomics overhaul.Gravatar mtklein2015-02-02
| | | | | | | | | | | | | | | | | | | | | | | | | This merges and refactors SkAtomics.h and SkBarriers.h into SkAtomics.h and some ports/ implementations. The major new feature is that we can express memory orders explicitly rather than only through comments. The porting layer is reduced to four template functions: - sk_atomic_load - sk_atomic_store - sk_atomic_fetch_add - sk_atomic_compare_exchange From those four we can reconstruct all our previous sk_atomic_foo. There are three ports: - SkAtomics_std: uses C++11 <atomic>, used with MSVC - SkAtomics_atomic: uses newer GCC/Clang intrinsics, used on not-MSVC where possible - SkAtomics_sync: uses older GCC/Clang intrinsics, used where SkAtomics_atomic not supported No public API changes. TBR=reed@google.com BUG=skia: Review URL: https://codereview.chromium.org/896553002
* Disable LCD text when rasterizing SkPictureShader tiles.Gravatar fmalita2015-02-02
| | | | | | | BUG=chromium:453299 R=reed@google.com Review URL: https://codereview.chromium.org/884163003
* Revert of Move npot resizing out of GrContext and simplify GrContext texture ↵Gravatar bsalomon2015-01-31
| | | | | | | | | | | | | | | | | | | | | functions. (patchset #10 id:200001 of https://codereview.chromium.org/882223003/) Reason for revert: perf fix didn't fix the cr webgl conformance tests Original issue's description: > Move npot resizing out of GrContext and simplify GrContext texture functions. > > Committed: https://skia.googlesource.com/skia/+/8a8100349105c8c6de39fcb34e47679da7a67f54 > > Committed: https://skia.googlesource.com/skia/+/6c96672491b04cb782bce8fee778124df66524a0 TBR=robertphillips@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/887303002
* Move npot resizing out of GrContext and simplify GrContext texture functions.Gravatar bsalomon2015-01-31
| | | | | | Committed: https://skia.googlesource.com/skia/+/8a8100349105c8c6de39fcb34e47679da7a67f54 Review URL: https://codereview.chromium.org/882223003
* Revert of Move npot resizing out of GrContext and simplify GrContext texture ↵Gravatar fmalita2015-01-31
| | | | | | | | | | | | | | | | | | | | | | | | | functions. (patchset #9 id:160001 of https://codereview.chromium.org/882223003/) Reason for revert: webGL conformance failures: WebglConformance.conformance_textures_tex_image_and_sub_image_2d_with_video WebglConformance.conformance_textures_texture_npot_video https://codereview.chromium.org/892773003/ http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/29272 Original issue's description: > Move npot resizing out of GrContext and simplify GrContext texture functions. > > Committed: https://skia.googlesource.com/skia/+/8a8100349105c8c6de39fcb34e47679da7a67f54 TBR=robertphillips@google.com,bsalomon@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/868233005
* export SkImageInfoGravatar reed2015-01-30
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/893603005
* Reland "remove unused SkAvoidXfermode"Gravatar scroggo2015-01-30
| | | | | | | | (patchset #2 id:20001 of https://codereview.chromium.org/860583002/) SkAvoidXfermode has been moved into Android, so it is safe to remove. Review URL: https://codereview.chromium.org/890893003
* Disable the noisiest /analyze warning in Chrome. ~3,700/12,000Gravatar brucedawson2015-01-30
| | | | | | | | | | | | | | | | | | Decades ago Intel decided that the bsr (Bit Scan Reverse) instruction should have undefined results if its argument is zero. This probably makes the instruction harder to implement and it definitely makes it more difficult to use. In SkCLZ_portable it requires a check for a zero argument, but despite that check /analyze still warns that _BitScanReverse might fail (because it doesn't know what can cause failures). Because this warning occurs in a frequently included header file it ends up being very noisy, accounting for ~30% of all warnings (before deduplication). Suppressing this useless warning will make the raw results easier to look through. Review URL: https://codereview.chromium.org/872673007
* Move npot resizing out of GrContext and simplify GrContext texture functions.Gravatar bsalomon2015-01-30
| | | | Review URL: https://codereview.chromium.org/882223003
* First cut at cleaning up Sergio's example code and moving some common code ↵Gravatar caryclark2015-01-30
| | | | | | | | | | to SkWindow. Eventually, this will be moved to be a peer of SampleApp so it is compiled by the bots to avoid future bit rot. Also ignore XCode auto-generated flag in CommandLineFlags, and remove the unused multiple-example part. Review URL: https://codereview.chromium.org/890873003
* Remove unused globalRef/globalUnref.Gravatar scroggo2015-01-30
| | | | | | BUG=skia:1482 Review URL: https://codereview.chromium.org/887993003
* Remove unused hasLocalMatrix.Gravatar scroggo2015-01-30
| | | | | | | | | | | This method is not called anywhere on Android or Chrome, and it has a FIXME that it may not be correct. A client can still getLocalMatrix().isIdentity() if they need this information. (It has the same FIXME, and perhaps we should revisit it. In the meantime, this convenience method is not needed.) Review URL: https://codereview.chromium.org/882443007
* Update comment for SkMallocPixelRef::NewWithProc.Gravatar scroggo2015-01-29
| | | | | | | | Add a comment about using a NULL ReleaseProc. BUG=skia:2185 Review URL: https://codereview.chromium.org/885573005
* share code between arcTo and addArc, update doxGravatar reed2015-01-29
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/863123005
* Make SkWriter32::snapshotAsData() a dumb copy.Gravatar mtklein2015-01-29
| | | | | | | | | SkWriter32::snapshotAsData() is no longer performance critical. It's only used when we're serializing to disk. BUG=skia:2289 Review URL: https://codereview.chromium.org/875403005
* Remove SkProxyCanvas.Gravatar scroggo2015-01-29
| | | | | | | | | | | | | | SkProxyCanvas is redundant with SkNWayCanvas, and means another class we have to keep in sync with the SkCanvas interface. Remove tests which use an SkProxyCanvas. Requires a change to chromium. BUG=skia:3279 BUG=skia:500 Review URL: https://codereview.chromium.org/886813002
* Fix wrapped content keys for npot textures.Gravatar bsalomon2015-01-28
| | | | Review URL: https://codereview.chromium.org/879193002
* Add a flag to flush the canvases during SkMultiPictureDraw::draw().Gravatar senorblanco2015-01-28
| | | | | | | | | | This is necessary for multisampling, so that each multisampled render target resolves before Chrome's compositor attempts to draw the texture. BUG=skia: Review URL: https://codereview.chromium.org/878653004
* Conservative SkTextBlob bounds.Gravatar fmalita2015-01-28
| | | | | | | | | | Compute cheaper/more conservative text blob bounds based on the typeface maximum glyph bbox. BUG=chromium:451401 R=reed@google.com,bungeman@google.com Review URL: https://codereview.chromium.org/886473002
* Fix GPU resource cache related assertions.Gravatar bsalomon2015-01-27
| | | | Review URL: https://codereview.chromium.org/879963003
* SkTypeface to use SkStreamAsset.Gravatar bungeman2015-01-27
| | | | | | | SkTypeface already requires typeface streams to support SkStreamAsset in practice, and in practice all users are already supplying them. Review URL: https://codereview.chromium.org/869763002
* Fix Chrome buildGravatar robertphillips2015-01-26
| | | | | | | | | | Switch SkShader's toString method to not be pure virtual due to derived classes in Chromium TBR=bsalomon@google.com NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/875043002
* Add patheffects to debugger printoutGravatar robertphillips2015-01-26
| | | | | | TBR=bsalomon@google.com Review URL: https://codereview.chromium.org/872043002
* initial preroll apiGravatar reed2015-01-25
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/855473002
* Fix the speeling of "purgeable" in Gr codeGravatar bsalomon2015-01-23
| | | | | | TBR=robertphillips@google.com Review URL: https://codereview.chromium.org/874693002
* Remove deprecated SkSurface::NewRenderTarget factoriesGravatar bsalomon2015-01-23
| | | | Review URL: https://codereview.chromium.org/837723008
* Take budgeted param when snapping new image.Gravatar bsalomon2015-01-23
| | | | Review URL: https://codereview.chromium.org/872543002
* Allow unbudgeted resources to be recycled by the cache as scratch.Gravatar bsalomon2015-01-23
| | | | Review URL: https://codereview.chromium.org/870743002
* Fix self assigment in GrResourceKeyGravatar bsalomon2015-01-23
| | | | | | | | TBR=robertphillips@google.com BUG=skia:3340 Review URL: https://codereview.chromium.org/866263007
* Remove GrBinHashKeyGravatar bsalomon2015-01-23
| | | | Review URL: https://codereview.chromium.org/861323002
* add newImage APIGravatar reed2015-01-23
| | | | | | | BUG=skia:3277 related bug: skbug.com/3276 Review URL: https://codereview.chromium.org/821083002
* Add specialized content key class for resources.Gravatar bsalomon2015-01-23
| | | | Review URL: https://codereview.chromium.org/858123002
* Rename GrOptDrawState to GrPipeline and GrDrawState to GrPipelineBuilderGravatar egdaniel2015-01-22
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/858343002
* remove (unused) GatherPixelRefsGravatar reed2015-01-22
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/869463002
* Fix SkIStream nits.Gravatar bungeman2015-01-22
| | | | | | | | | Fix comment, constness of one field, and delete already checks for NULL. TBR=reed@google.com Trivial change to debatably public api. Review URL: https://codereview.chromium.org/868643003
* XPFactory lazily initializie in drawstate / GrPaintGravatar joshualitt2015-01-22
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/866573002
* Remove the need for asCoeff in SkXfermode.Gravatar egdaniel2015-01-22
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/864833002
* Remove staging SkStream::unref().Gravatar bungeman2015-01-22
| | | | | | | | | SkStream::unref() was added to ease transitioning off of SkStream deriving from SkRefCnt. It is no longer needed, remove it. TBR=reed@google.com Review URL: https://codereview.chromium.org/861413002
* Move sync code to include/, switch from using platform define to a proxy ↵Gravatar mtklein2015-01-21
| | | | | | | | | | | | | | header in core/ This fixes two problems: 1) #include SK_SOME_DEFINE doesn't work well for all our clients. 2) Things in include/ are #including things in src/, which we don't like. TBR=reed@google.com BUG=skia: Review URL: https://codereview.chromium.org/862983002
* Make SkStream *not* ref counted.Gravatar scroggo2015-01-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SkStream is a stateful object, so it does not make sense for it to have multiple owners. Make SkStream inherit directly from SkNoncopyable. Update methods which previously called SkStream::ref() (e.g. SkImageDecoder::buildTileIndex() and SkFrontBufferedStream::Create(), which required the existing owners to call SkStream::unref()) to take ownership of their SkStream parameters and delete when done (including on failure). Switch all SkAutoTUnref<SkStream>s to SkAutoTDelete<SkStream>s. In some cases this means heap allocating streams that were previously stack allocated. Respect ownership rules of SkTypeface::CreateFromStream() and SkImageDecoder::buildTileIndex(). Update the comments for exceptional methods which do not affect the ownership of their SkStream parameters (e.g. SkPicture::CreateFromStream() and SkTypeface::Deserialize()) to be explicit about ownership. Remove test_stream_life, which tested that buildTileIndex() behaved correctly when SkStream was a ref counted object. The test does not make sense now that it is not. In SkPDFStream, remove the SkMemoryStream member. Instead of using it, create a new SkMemoryStream to pass to fDataStream (which is now an SkAutoTDelete). Make other pdf rasterizers behave like SkPDFDocumentToBitmap. SkPDFDocumentToBitmap delete the SkStream, so do the same in the following pdf rasterizers: SkPopplerRasterizePDF SkNativeRasterizePDF SkNoRasterizePDF Requires a change to Android, which currently treats SkStreams as ref counted objects. Review URL: https://codereview.chromium.org/849103004
* Reland https://codereview.chromium.org/860333002 with fix for test failures.Gravatar bsalomon2015-01-21
| | | | | | | | | | Revert "Revert of Make GrScratchKey memory buffer correct size on copy (patchset #1 id:1 of https://codereview.chromium.org/860333002/)" This reverts commit 988018c817f341c0ce09297b7ba5ba60ba76eba9. BUG=skia: Review URL: https://codereview.chromium.org/863983003
* Revert of Make GrScratchKey memory buffer correct size on copy (patchset #1 ↵Gravatar mtklein2015-01-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | id:1 of https://codereview.chromium.org/860333002/) Reason for revert: Our Valgrind bot just spewed out a weird error. I don't know if it's related, but it looks at least like one of the stacks was in the right area, so I'm going to revert this precautionarily. Sorry if this is a false positive. http://build.chromium.org/p/client.skia/builders/Test-Ubuntu12-ShuttleA-GTX550Ti-x86_64-Release-Valgrind/builds/266/steps/dm/logs/stdio Original issue's description: > Make GrScratchKey memory buffer correct size on copy > > Scratch key memory buffer of a copy of a key was too big. The (new) copy > was N times uint32_t bytes instead of N bytes. > > Adds few tests to resource cache. These tests would not catch the too > big buffer. This is just a precaution for too small buffers. The main > idea of the test change is that the scratch key should contain some > information, so that lookup with a scratch key can also return no > match. Otherwise testing of scratch lookup result is not indicative of > correct code (eg. no-information scratch key will always match). > > Committed: https://skia.googlesource.com/skia/+/711ef4831363fb8cbdf061dc2c36c65b13c0ccf2 TBR=bsalomon@google.com,kkinnunen@nvidia.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/864833003
* Make GrScratchKey memory buffer correct size on copyGravatar kkinnunen2015-01-21
| | | | | | | | | | | | | | Scratch key memory buffer of a copy of a key was too big. The (new) copy was N times uint32_t bytes instead of N bytes. Adds few tests to resource cache. These tests would not catch the too big buffer. This is just a precaution for too small buffers. The main idea of the test change is that the scratch key should contain some information, so that lookup with a scratch key can also return no match. Otherwise testing of scratch lookup result is not indicative of correct code (eg. no-information scratch key will always match). Review URL: https://codereview.chromium.org/860333002