aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkPixelRef.h
Commit message (Collapse)AuthorAge
* Update Skia's YUV APIGravatar msarett2016-03-10
| | | | | | | | | | | | | | We should match the recently designed API in SkCodec. https://codereview.chromium.org/1549473003/ This requires changes in Chromium as well. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1716523002 Committed: https://skia.googlesource.com/skia/+/095d31c8a0eeb5d491febf064bc3c8a44e22b94f Review URL: https://codereview.chromium.org/1716523002
* Revert of Update Skia's YUV API (patchset #5 id:160001 of ↵Gravatar msarett2016-03-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1716523002/ ) Reason for revert: Blimp failures with manual roll in Chrome. Original issue's description: > Update Skia's YUV API > > We should match the recently designed API in SkCodec. > https://codereview.chromium.org/1549473003/ > > This requires changes in Chromium as well. > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1716523002 > > Committed: https://skia.googlesource.com/skia/+/095d31c8a0eeb5d491febf064bc3c8a44e22b94f TBR=scroggo@google.com,reed@google.com,bsalomon@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1775493002
* Update Skia's YUV APIGravatar msarett2016-03-07
| | | | | | | | | | | | We should match the recently designed API in SkCodec. https://codereview.chromium.org/1549473003/ This requires changes in Chromium as well. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1716523002 Review URL: https://codereview.chromium.org/1716523002
* Move SkTDArray to private.Gravatar bungeman2016-02-18
| | | | | | | TBR=reed Moving to private is good. Review URL: https://codereview.chromium.org/1707213002
* Add SkSpecialImage & SkSpecialSurface classesGravatar robertphillips2016-02-04
| | | | | | | | Initial classes. GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1579323002 Review URL: https://codereview.chromium.org/1579323002
* Make SkBitmap::CopyTo respect requested dst color type when bitmap is ↵Gravatar bsalomon2016-01-11
| | | | | | | | | texture backed. BUG=chromium:550559 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1576983002 Review URL: https://codereview.chromium.org/1576983002
* Move Mutexy things to private.Gravatar herb2015-09-29
| | | | | | | | | | There is no API change. TBR=reed@google.com BUG=skia: Review URL: https://codereview.chromium.org/1368333004
* Move SkAtomics.h to private.Gravatar herb2015-09-28
| | | | | | | | | | There are no API changes. TBR=reed@google.com BUG=skia: Review URL: https://codereview.chromium.org/1369333004
* SkImage method for detecting lazy decodingGravatar fmalita2015-08-20
| | | | | | | BUG=skia:4224 R=reed@google.com Review URL: https://codereview.chromium.org/1305453007
* private iterator to visit all resource cache entriesGravatar reed2015-08-19
| | | | | | | BUG=skia: TBR= Review URL: https://codereview.chromium.org/1271033002
* Every pixel ref gets its own mutex.Gravatar mtklein2015-08-13
| | | | | | | | Seems like a memory-saving flourish follow up would be to use SkSpinlock. BUG=Florin's email. Review URL: https://codereview.chromium.org/1289623004
* Extend SkImageGenerator to support natively generated GrTextures. As part of ↵Gravatar reed2015-08-13
| | | | | | | | | | | | this, added uniqueID() to the generator, and made it be in the same namespace is bitmaps, pixelrefs, images. To do this, create SkImageCacherator, which wraps a generator and provides an interface to get a cached answer for either the raster or texture output of the generator. BUG=skia: Review URL: https://codereview.chromium.org/1291803002
* cache private readback for gpu-imagesGravatar reed2015-08-04
| | | | | | | | | | | | Does not try to cache calls to readPixels at the moment: - not triggered by drawing - not clear if we want to perform any pixel transformations (that readPixels allows) on the GPU or CPU Can consider that another time. BUG=513695 Review URL: https://codereview.chromium.org/1262923003
* lock pixels in image when bitmap is immutable and not-lazyGravatar reed2015-07-30
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1266143003
* SkImage_Raster's pixels are always immutable.Gravatar reed2015-07-29
| | | | | | | | | | | | | | | | | | To make this work, we tag their pixelrefs as temporarily immutable, allowing ourselves to restore the pixels to mutability only when the image drops away. This should allow us to wobble back and forth between writing to the Surface and reading from the Image without a COW, with the Surface seeing mutable pixels and the Image seeing immutable pixels. The big idea is, Image doesn't need forever-immutable pixels, it just needs pixels that are immutable as long as it's alive. BUG=skia: patch from issue 804523002 at patchset 40001 (http://crrev.com/804523002#ps40001) Review URL: https://codereview.chromium.org/1254383006
* remove SkInstCntGravatar mtklein2015-06-26
| | | | | | | | | | | | | | It's been outclassed by Valgrind and leak sanitizer, and it seems to be causing problems for external folks building Skia. I'm not sure why our own builds seem unaffected. Latest thread: https://groups.google.com/forum/#!topic/skia-discuss/oj9FsQwwSF0 BUG=skia: Review URL: https://codereview.chromium.org/1217573002
* Invalidate GrTexture mipmap on content change notificationGravatar junov2015-06-15
| | | | | | | | | | | This fix is necessary to correctly propagate invalidations that are external to skia. For example, when drawing video or WebGL into a 2D canvas in Chrome, with mipmaps enabled. BUG=crbug.com/498356 TEST=GrTextureMipMapInvalidationTest Review URL: https://codereview.chromium.org/1177843007
* Revert[6] of add asserts around results from requestLockGravatar reed2015-05-30
| | | | | | | | | This reverts commit 11e833d91b5ba2193ed593cb74900dddbec24b6f. BUG=skia: TBR= Review URL: https://codereview.chromium.org/1159183003
* Revert of Revert[4] of add asserts around results from requestLock (patchset ↵Gravatar reed2015-05-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #3 id:40001 of https://codereview.chromium.org/1159733006/) Reason for revert: gfx_unittests (under linux_asan) @@@STEP_LOG_LINE@RenderTextTest.HarfBuzz_HorizontalPositions@Direct leak of 368 byte(s) in 1 object(s) allocated from:@@@ @@@STEP_LOG_LINE@RenderTextTest.HarfBuzz_HorizontalPositions@ #0 0x4cc74b in __interceptor_malloc (/b/build/slave/linux_asan/build/src/out/Release/gfx_unittests+0x4cc74b)@@@ @@@STEP_LOG_LINE@RenderTextTest.HarfBuzz_HorizontalPositions@ #1 0x7f2f7060ebdf in _cairo_image_surface_create_for_pixman_image /build/buildd/cairo-1.10.2/src/cairo-image-surface.c:158@@@ @@@STEP_LOG_LINE@RenderTextTest.HarfBuzz_HorizontalPositions@@@@ @@@STEP_LOG_LINE@RenderTextTest.HarfBuzz_HorizontalPositions@Indirect leak of 256 byte(s) in 1 object(s) allocated from:@@@ @@@STEP_LOG_LINE@RenderTextTest.HarfBuzz_HorizontalPositions@ #0 0x4cc74b in __interceptor_malloc (/b/build/slave/linux_asan/build/src/out/Release/gfx_unittests+0x4cc74b)@@@ @@@STEP_LOG_LINE@RenderTextTest.HarfBuzz_HorizontalPositions@ #1 0x7f2f6c7be26a in _pixman_image_allocate /build/buildd/pixman-0.30.2/build/pixman/../../pixman/pixman-image.c:184@@@ @@@STEP_LOG_LINE@RenderTextTest.HarfBuzz_HorizontalPositions@@@@ I think they are creating a cairo surface, but it has no pixels (zero size?). In this CL, if I see no pixels, I ignore the call-back which is used to free the surface (doh). Original issue's description: > Revert[4] of add asserts around results from requestLock > > This reverts commit 19663e54c017499406036746e7689193aa6417e6. > > BUG=skia: > TBR= > > Committed: https://skia.googlesource.com/skia/+/df91b73a34e3a306c93a5e320704736255c3d9f0 TBR=reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1151063005
* Revert[4] of add asserts around results from requestLockGravatar reed2015-05-30
| | | | | | | | | This reverts commit 19663e54c017499406036746e7689193aa6417e6. BUG=skia: TBR= Review URL: https://codereview.chromium.org/1159733006
* Revert of add asserts around results from requestLock (patchset #3 id:40001 ↵Gravatar reed2015-05-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | of https://codereview.chromium.or… (patchset #1 id:1 of https://codereview.chromium.org/1165583005/) Reason for revert: failure in cc_unittests (need to diagnose) @@@STEP_LOG_LINE@ResourceProviderTests_ResourceProviderTest.TransferInvalidSoftware_1@ResourceProviderTests/ResourceProviderTest.TransferInvalidSoftware/1 (run #1):@@@ @@@STEP_LOG_LINE@ResourceProviderTests_ResourceProviderTest.TransferInvalidSoftware_1@[ RUN ] ResourceProviderTests/ResourceProviderTest.TransferInvalidSoftware/1@@@ @@@STEP_LOG_LINE@ResourceProviderTests_ResourceProviderTest.TransferInvalidSoftware_1@[17114:17114:0529/180822:15336467671:INFO:SkPixelRef.cpp(168)] ../../third_party/skia/src/core/SkPixelRef.cpp:168: failed assertion "pixels"@@@ Original issue's description: > add asserts around results from requestLock (patchset #3 id:40001 of https://codereview.chromium.org/1155403003/)" > > This reverts commit 3953d360417655b8000df0951699121383db45c3. > > BUG=skia: > TBR= > > Committed: https://skia.googlesource.com/skia/+/6980f5a96455c8062403c995a64b654a0e9a1319 TBR= NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1151573009
* add asserts around results from requestLock (patchset #3 id:40001 of ↵Gravatar reed2015-05-29
| | | | | | | | | | | https://codereview.chromium.org/1155403003/)" This reverts commit 3953d360417655b8000df0951699121383db45c3. BUG=skia: TBR= Review URL: https://codereview.chromium.org/1165583005
* Revert of add asserts around results from requestLock (patchset #3 id:40001 ↵Gravatar reed2015-05-29
| | | | | | | | | | | | | | | | | | | | | | | | | | of https://codereview.chromium.org/1155403003/) Reason for revert: asserts in ui/gfx unittests (need to investigate why) [ RUN ] RenderTextTest.SelectionKeepsLigatures [14602:14602:0529/134016:16779526944:INFO:SkPixelRef.cpp(164)] ../../third_party/skia/src/core/SkPixelRef.cpp:164: failed assertion "pixels" Original issue's description: > add asserts around results from requestLock and lockPixels, ensuring that true always means we have non-null pixels (and non-null colortable if that matches the colortype) > > BUG= 491975 > TBR= > > Committed: https://skia.googlesource.com/skia/+/f941a68126d8fe647eaea902c244c466568b7809 TBR=scroggo@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG= 491975 Review URL: https://codereview.chromium.org/1159013006
* add asserts around results from requestLock and lockPixels, ensuring that ↵Gravatar reed2015-05-29
| | | | | | | | | true always means we have non-null pixels (and non-null colortable if that matches the colortype) BUG= 491975 TBR= Review URL: https://codereview.chromium.org/1155403003
* add SkPixmap and external locking to bitmapsGravatar reed2015-05-22
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1074983003
* Steal a bit from the gen ID instead of managing two atomic values.Gravatar mtklein2015-02-25
| | | | | | | | | | | | This extra atomic bool is hard to think about, and I'm worried about how updates to fGenerationID and fUniqueGenerationID interlace. By storing them in the same int, they can't ever race. CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu13.10-GCE-NoGPU-x86_64-Release-TSAN-Trybot BUG=skia: Review URL: https://codereview.chromium.org/955043002
* Revert of fAddedToCache doesn't need to be atomic. (patchset #1 id:1 of ↵Gravatar mtklein2015-02-25
| | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/960573002/) Reason for revert: Yes it does. notifyAddedToCache() must be thread-safe. Original issue's description: > fAddedToCache doesn't need to be atomic. > > It's only ever read or set from non-threadsafe methods. > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/fbe0edfec4fed2a09e12b049d527d280f16e75b3 TBR=reed@google.com,mtklein@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/959763002
* fAddedToCache doesn't need to be atomic.Gravatar mtklein2015-02-25
| | | | | | | | It's only ever read or set from non-threadsafe methods. BUG=skia: Review URL: https://codereview.chromium.org/960573002
* only notify bitmaps that have been added to the cacheGravatar reed2015-02-25
| | | | | | | | | | | | old code: - calls=2677 hit-rate=3.51139% new code: - calls=94 hit-rate=97.8723% BUG=skia: Review URL: https://codereview.chromium.org/960563002
* SkTRacy<T> -> SkAtomic<T>Gravatar mtklein2015-02-24
| | | | | | | | | | | | | | | | | | | | Like SkTRacy<T>, TSAN will not complain about these. Unlike SkTRacy<T>, TSAN should not complain about these: SkAtomic<T> are threadsafe. This should fix the races now suppressed in TSAN. As written, the memory barriers we're using in SkPixelRef will be dumb but safe (really, dumbest possible but safest possible). If we see a perf hit, we can follow up by putting Ben and I in a room for a while, thinking about it really hard, and using the minimum-strength safe memory barriers. A refactor that steals a bit from the genID would also still be possible with this approach. BUG=chromium:437511 CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu13.10-GCE-NoGPU-x86_64-Release-TSAN-Trybot Review URL: https://codereview.chromium.org/955803002
* Make SkPixelRef::isLocked() debug-only, remove related dead code.Gravatar mtklein2015-02-20
| | | | | | | | | | DM's okay locally with no diffs, no failures. BUG=skia: Committed: https://skia.googlesource.com/skia/+/8e65712486c66108677a9b0a55ad3e7ca94db555 Review URL: https://codereview.chromium.org/940083002
* Revert of Make SkPixelRef::isLocked() debug-only, remove related dead code. ↵Gravatar reed2015-02-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | (patchset #1 id:1 of https://codereview.chromium.org/940083002/) Reason for revert: Broke callers in chrome ../../skia/ext/platform_canvas_unittest.cc:421:56: error: no member named 'isLocked' in 'SkPixelRef' EXPECT_TRUE(platform_bitmap->GetBitmap().pixelRef()->isLocked()); Original issue's description: > Make SkPixelRef::isLocked() debug-only, remove related dead code. > > DM's okay locally with no diffs, no failures. > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/8e65712486c66108677a9b0a55ad3e7ca94db555 TBR=reed@google.com,mtklein@google.com,mtklein@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/940323003
* Make SkPixelRef::isLocked() debug-only, remove related dead code.Gravatar mtklein2015-02-19
| | | | | | | | DM's okay locally with no diffs, no failures. BUG=skia: Review URL: https://codereview.chromium.org/940083002
* Revert of I cannot remember what the race here actually was. (patchset #1 ↵Gravatar mtklein2015-02-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | id:1 of https://codereview.chromium.org/922873002/) Reason for revert: http://build.chromium.org/p/client.skia/builders/Test-Ubuntu13.10-GCE-NoGPU-x86_64-Release-TSAN/builds/1557/steps/dm/logs/stdio Original issue's description: > I cannot remember what the race here actually was. > > Removing SkTRacy will show us, or perhaps show us we already fixed the race. > > BUG=chromium:437511 > > No public API changes. > TBR=reed@google.com > > Committed: https://skia.googlesource.com/skia/+/71409c83e69b387b3c5d567197d0421c36baf68d TBR=bungeman@google.com,mtklein@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=chromium:437511 Review URL: https://codereview.chromium.org/923543003
* I cannot remember what the race here actually was.Gravatar mtklein2015-02-12
| | | | | | | | | | | Removing SkTRacy will show us, or perhaps show us we already fixed the race. BUG=chromium:437511 No public API changes. TBR=reed@google.com Review URL: https://codereview.chromium.org/922873002
* Port SkLazyPtr to new SkAtomics.hGravatar mtklein2015-02-09
| | | | | | | | | | | | | | | | | | No algorithmic changes. The new APIs let us avoid a few ugly trips through void*, and I've made the consume/acquire/release decision explicitly conditioned on TSAN. This should fix the attached bug, which is TSAN seeing us implementing the sk_consume_load() with a relaxed load, where we used to pass __ATOMIC_CONSUME to TSAN. This restores us to the status quo of a couple weeks ago, where we use relaxed loads (to avoid an extra dmb on ARM) for all setups except TSAN, who gets the logically correct memory order, consume. No public API changes. TBR=reed@google.com BUG=chromium:455606 Review URL: https://codereview.chromium.org/908943002
* Remove unused globalRef/globalUnref.Gravatar scroggo2015-01-30
| | | | | | BUG=skia:1482 Review URL: https://codereview.chromium.org/887993003
* Add sRGB texture support.Gravatar jvanverth2014-12-22
| | | | Review URL: https://codereview.chromium.org/791823003
* Add an Android-framework-only stable ID to SkPixelRef.Gravatar scroggo2014-11-25
| | | | | | BUG:b/18245805 Review URL: https://codereview.chromium.org/752203002
* Enable unused param checking for public includes.Gravatar djsollen2014-11-14
| | | | | | | | | | This CL cleans up the existing violations and enables the build time check to ensure that we don't regress. The motiviation behind this change is to allow clients who include our headers to be able to build with this warning enabled. Review URL: https://codereview.chromium.org/726923002
* Add support for the Rec601 YUV color space to GrYUVtoRGBEffect.Gravatar rileya2014-09-12
| | | | | | | | R=bsalomon@google.com, senorblanco@chromium.org, sugoi@chromium.org, reed@google.com Author: rileya@chromium.org Review URL: https://codereview.chromium.org/516463005
* Skia side RGB to YUV gpu conversionGravatar sugoi2014-07-21
| | | | | | | | | | | This code is the one that's currently working in my local chromium build. A few things still need to be addressed and I'll highlight these directly in the code. BUG=skia: R=reed@google.com, bsalomon@google.com, senorblanco@google.com, senorblanco@chromium.org, robertphillips@google.com, scroggo@google.com, halcanary@google.com Author: sugoi@chromium.org Review URL: https://codereview.chromium.org/374743003
* remove unused SkPixelRef constructorGravatar reed2014-07-14
| | | | | | | | TBR= Author: reed@google.com Review URL: https://codereview.chromium.org/390893002
* remove SK_SUPPORT_LEGACY_PIXELREF_UNFLATTENABLE codeGravatar reed2014-07-14
| | | | | | | | TBR= Author: reed@google.com Review URL: https://codereview.chromium.org/387313004
* Add SkRacyGravatar mtklein2014-07-08
| | | | | | | | | | | | | | | | | | | | | | | SkRacy<T> is a zero-overhead wrapper for a T, except it also silences race warnings when TSAN is running. Here we apply in several classes. In SkMatrix and SkPathRef, we use it to opportunistically cache some idempotent work. In SkPixelRef, we wrap the genIDs. We think the worst that can happen here is we'll increment the global next-genID a few times instead of once when we go to get another ID. BUG=skia: Committed: https://skia.googlesource.com/skia/+/d5e3e6ae1b3434ad1158f441902ff65f1eeaa3a7 CQ_EXTRA_TRYBOTS=tryserver.skia:Canary-Chrome-Ubuntu13.10-Ninja-x86_64-ToT-Trybot,Canary-Chrome-Win7-Ninja-x86-SharedLib_ToT-Trybot,Test-Ubuntu13.10-GCE-NoGPU-x86_64-Release-TSAN-Trybot R=reed@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/371363004
* Revert of Add SkRacy (https://codereview.chromium.org/371363004/)Gravatar mtklein2014-07-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reason for revert: hidden symbol 'AnnotateBenignRaceSized' in obj/base/third_party/dynamic_annotations/libdynamic_annotations.a(obj/base/third_party/dynamic_annotations/dynamic_annotations.dynamic_annotations.o) is referenced by DSO lib/libblink_platform.so Original issue's description: > Add SkRacy > > SkRacy<T> is a zero-overhead wrapper for a T, except it also > silences race warnings when TSAN is running. > > Here we apply in several classes. In SkMatrix and SkPathRef, > we use it to opportunistically cache some idempotent work. > > In SkPixelRef, we wrap the genIDs. We think the worst that > can happen here is we'll increment the global next-genID a > few times instead of once when we go to get another ID. > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/d5e3e6ae1b3434ad1158f441902ff65f1eeaa3a7 R=reed@google.com, mtklein@chromium.org TBR=mtklein@chromium.org, reed@google.com NOTREECHECKS=true NOTRY=true BUG=skia: Author: mtklein@google.com Review URL: https://codereview.chromium.org/377693005
* Add SkRacyGravatar mtklein2014-07-08
| | | | | | | | | | | | | | | | | | | SkRacy<T> is a zero-overhead wrapper for a T, except it also silences race warnings when TSAN is running. Here we apply in several classes. In SkMatrix and SkPathRef, we use it to opportunistically cache some idempotent work. In SkPixelRef, we wrap the genIDs. We think the worst that can happen here is we'll increment the global next-genID a few times instead of once when we go to get another ID. BUG=skia: R=reed@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/371363004
* change pixelref to not inherit from SkFlattenableGravatar reed2014-07-07
| | | | | | | | | | If I can "inline" MallocPixelRef unflatten, then I think we can delete this code. The only caller today should be unflattening in the legacy path for bitmaps. R=robertphillips@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/320873003
* correctly plumb through explicit rowbytes for allocPixelsGravatar reed2014-07-01
| | | | | | | | | BUG=skia: R=caryclark@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/357073003
* switch to colortype for deepcopyGravatar reed2014-06-11
| | | | | | | | | BUG=skia: R=robertphillips@google.com, bsalomon@google.com, reed@google.com Author: reed@chromium.org Review URL: https://codereview.chromium.org/323283002