aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkStream.h
Commit message (Collapse)AuthorAge
* Mark all deleted methods privateGravatar Hal Canary2018-06-21
| | | | | | | | Change-Id: I33f51efeaeabcdd7add2a88d89ecc9c1e8c054d7 Reviewed-on: https://skia-review.googlesource.com/135380 Auto-Submit: Hal Canary <halcanary@google.com> Commit-Queue: Cary Clark <caryclark@google.com> Reviewed-by: Cary Clark <caryclark@google.com>
* SkCanvas, SkImageGenerator, SkStream: remove SkNoncopyableGravatar Hal Canary2018-06-14
| | | | | | | | Change-Id: If2b27f62c3d825b388239ef6ee35722d46eed664 Reviewed-on: https://skia-review.googlesource.com/134949 Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* Revert "Revert "SkTypes: extract SkTo""Gravatar Hal Canary2018-06-14
| | | | | | | | | | | | | | | | This reverts commit fdcfb8b7c23fbf18f872d2c31d27978235033876. > Original change's description: > > SkTypes: extract SkTo > > > > Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09 > > Reviewed-on: https://skia-review.googlesource.com/133620 > > Reviewed-by: Mike Klein <mtklein@google.com> Change-Id: Ida74fbc5c21248a724a5edbf9fae18a33bcb23aa Reviewed-on: https://skia-review.googlesource.com/134506 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* Revert "SkTypes: extract SkTo"Gravatar Hal Canary2018-06-13
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit 2a2f67592602b18527bc3fd449132d420cd5b62e. Reason for revert: this appears to be what is holding up the Chrome roll. Original change's description: > SkTypes: extract SkTo > > Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09 > Reviewed-on: https://skia-review.googlesource.com/133620 > Reviewed-by: Mike Klein <mtklein@google.com> TBR=mtklein@google.com,halcanary@google.com No-Presubmit: true No-Tree-Checks: true No-Try: true Change-Id: Iafd738aedfb679a23c061a51afe4b98a8d4cdfae Reviewed-on: https://skia-review.googlesource.com/134504 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* SkTypes: extract SkToGravatar Hal Canary2018-06-12
| | | | | | Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09 Reviewed-on: https://skia-review.googlesource.com/133620 Reviewed-by: Mike Klein <mtklein@google.com>
* Make SkStream readers report failure.Gravatar Ben Wagner2018-05-18
| | | | | | | | | | This also fixes an issue noticed while making this change where SkFontDescriptor improperly round trips negative axis values. Change-Id: Iacc5929a185659dcacc18c802c4908e4f34c6899 Reviewed-on: https://skia-review.googlesource.com/128341 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com>
* Treat SkFILEStream's fOriginalOffset as the startGravatar Leon Scroggins III2018-05-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: b/78866720 ::rewind() rewinds to fOriginalOffset ::seek(position) seeks to position + fOriginalOffset ::move(offset) will not move < fOriginalOffset ::getPosition() returns position relative to fOriginalOffset ::getLength() returns full size minus fOriginalOffset ::duplicate() and ::fork() pass on fOriginalOffset Android may create an SkFILEStream using a file descriptor whose offset is at the beginning of the data that Android cares about. Treat all positions in SkFILEStream as relative to that original offset. This allows AnimatedImageDrawable to read directly from the SkFILEStream, rather than using an SkFrontBufferedStream and forcing SkGifCodec to cache data for later use. This fixes a TODO that was introduced in https://skia-review.googlesource.com/c/skia/+/9498 and takes it a step further. In that CL, bungeman@ and I discussed the change and decided to "leave this alone for now to avoid changing behavior". Doing a code search today, the only two callers want the new behavior. Change-Id: I9211394d5b730adf528fac0df0af7a664b1295be Reviewed-on: https://skia-review.googlesource.com/126511 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* remove dead code for STREAM_APIGravatar Mike Reed2017-09-20
| | | | | | | | Bug: skia: Change-Id: I5c5a65710af443c60a3d13fb309ce31309be7f74 Reviewed-on: https://skia-review.googlesource.com/49460 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Revert "Revert "use unique_ptr for stream api""Gravatar Mike Reed2017-09-16
| | | | | | | | | | This reverts commit 7031b247c9fe0cb8fa32129f9bc24fea2043cee2. Bug: skia: Change-Id: I24c34bbee703f02994be8e206bcb9c10b5427d84 Reviewed-on: https://skia-review.googlesource.com/47541 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Revert "use unique_ptr for stream api"Gravatar Mike Reed2017-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 49f1f34438d3431f6d7e32847accd2ba96948a73. Reason for revert: broke win-chrome ../../third_party/skia/src/ports/SkFontMgr_win_dw.cpp(89): error C2228: left of '.release' must have class/struct/union ../../third_party/skia/src/ports/SkFontMgr_win_dw.cpp(89): note: type is 'SkStreamAsset *' ../../third_party/skia/src/ports/SkFontMgr_win_dw.cpp(89): note: did you intend to use '->' instead? Original change's description: > use unique_ptr for stream api > > Bug: skia:6888 > Change-Id: I3459b4913982a7cae1c0061697c82cc65ad9a2d8 > Reviewed-on: https://skia-review.googlesource.com/26740 > Reviewed-by: Mike Klein <mtklein@chromium.org> > Commit-Queue: Mike Reed <reed@google.com> TBR=mtklein@chromium.org,mtklein@google.com,bungeman@google.com,reed@google.com Change-Id: Ic1e4af557317abd06b7f6b7f5056645df7e469f0 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:6888 Reviewed-on: https://skia-review.googlesource.com/47440 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* use unique_ptr for stream apiGravatar Mike Reed2017-09-15
| | | | | | | | Bug: skia:6888 Change-Id: I3459b4913982a7cae1c0061697c82cc65ad9a2d8 Reviewed-on: https://skia-review.googlesource.com/26740 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* SkFILEStream::Make: fix leak.Gravatar Hal Canary2017-08-28
| | | | | | | Change-Id: I218ae89f049df3d05380b46ca672bb1f6fcb5ea4 Reviewed-on: https://skia-review.googlesource.com/38962 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* Convert NULL and 0 to nullptr.Gravatar Ben Wagner2017-08-28
| | | | | | | | | | | | | | This was created by looking at warnings produced by clang's -Wzero-as-null-pointer-constant. This updates most issues in Skia code. However, there are places where GL and Vulkan want pointer values which are explicitly 0, external headers which use NULL directly, and possibly more uses in un-compiled sources (for other platforms). Change-Id: Id22fbac04d5c53497a53d734f0896b4f06fe8345 Reviewed-on: https://skia-review.googlesource.com/39521 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* add Make factory to SkMemoryStream (simplify call-sites)Gravatar Mike Reed2017-07-26
| | | | | | | | Bug: skia:6888 Change-Id: Ia4e432673ed089a91229697c8dde0489f220000d Reviewed-on: https://skia-review.googlesource.com/26884 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* SkStream: DynamicMemoryWStream gets writeToAndResetGravatar Hal Canary2017-05-24
| | | | | | | | | | | | | This is similar to copyToAndReset(). Also use this in SkPDF, for minor memory savings: Single-threaded DM's peak RSS drops from 239MB to 228MB. Change-Id: I352a980e6dd54eb05d74cd057bd50e02312753b0 Reviewed-on: https://skia-review.googlesource.com/17714 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* Remove unnecessary SkFILEStream::getMemoryBaseGravatar Leon Scroggins III2017-05-01
| | | | | | | | | | It overrides the SkStream:: version, but does the same thing. Change-Id: I857f2119a85bb3f942707ab3cef58b45a2cf4b7a Reviewed-on: https://skia-review.googlesource.com/14828 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* Mark overridden destructors with 'override' and remove 'virtual'Gravatar Brian Salomon2017-03-22
| | | | | | | | | This silences a new warning in clang 5.0 Change-Id: Ieb5b75a6ffed60107c3fd16075d2ecfd515b55e8 Reviewed-on: https://skia-review.googlesource.com/10006 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* test (and fix) clip_restriction in canvasGravatar Mike Reed2017-03-22
| | | | | | | | | BUG=skia: Change-Id: I86d25d0fd82be35d01471fba59f77b360be5373c Reviewed-on: https://skia-review.googlesource.com/9995 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Derek Sollenberger <djsollen@google.com>
* SkDynamicMemoryWStream::detachAsStream() returns unique_ptrGravatar Hal Canary2017-03-15
| | | | | | | | https://crrev.com/2747183002 must land first. Change-Id: I65d1285a24d63c2c2f18662d511dea1c399511e1 Reviewed-on: https://skia-review.googlesource.com/9682 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* SkDynamicMemoryWStream::detachAsData more memory efficentGravatar Hal Canary2017-03-15
| | | | | | | | | | I did some testing with very large datasets, and the difference in max RSS is measurable and significant. Change-Id: I6bb2f795d5b4f6ebdba42c3089dc85a278355d48 Reviewed-on: https://skia-review.googlesource.com/9686 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* Fix SkFILEStream.Gravatar Ben Wagner2017-03-10
| | | | | | | Change-Id: I8c66e4e3e857227aed3d0bc497982f4c0d96d917 Reviewed-on: https://skia-review.googlesource.com/9498 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com>
* remove SkMemoryWStream -- unused externallyGravatar Mike Reed2017-01-08
| | | | | | | | | BUG=skia: Change-Id: Idbc9af4e703238871f56f623cd616fb7a5e686d3 Reviewed-on: https://skia-review.googlesource.com/6727 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Mike Reed <reed@google.com>
* remove SkDebugWStream and other cleanupsGravatar Mike Reed2017-01-07
| | | | | | | | | BUG=skia: Change-Id: I06c07559b24411bd8bc4cba55bd8880f56486f76 Reviewed-on: https://skia-review.googlesource.com/6729 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Remove SkDynamicMemoryWStream::getOffset.Gravatar Ben Wagner2016-12-16
| | | | | | | | | | This method does the same thing as ::bytesWritten but has a confusing name. It appears there are no external users, so remove it. Change-Id: I06aed269200c34c2dda36605092f8ea37fcec693 Reviewed-on: https://skia-review.googlesource.com/6188 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* speedup dynamicwstreamGravatar Mike Reed2016-12-15
| | | | | | | | | | | | | | | | | - move bytesWritten calculation to query the tail, allowing write() to be faster since it doesn't have to update anything extra per-write. - enforce that all blocks are multiple-of-4 bytes big - update the minimum block size to 4K Before: 30ms After: 23ms for non-4-bytes writes 13ms for 4-bytes writes BUG=skia: Change-Id: Id06ecad3b9fe426747e02accf1393595e3356ce3 Reviewed-on: https://skia-review.googlesource.com/6087 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* remove unused dynamicwstream.snapshotAsData()Gravatar Mike Reed2016-12-15
| | | | | | | | | | | | Checking to invalidate this on every write() call has a measurable cost, so removing it both simplifies the class and speeds it up. BUG=skia: Change-Id: Idf0baa265c9a0b5d26d82fce948c61ed9b0810b1 Reviewed-on: https://skia-review.googlesource.com/6096 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* Remove strange 'write' overload on SkDynamicMemoryWStream.Gravatar bungeman2016-12-14
| | | | | | | | | This should have been names 'overwrite' and appears to be unused. Change-Id: Ic9dd21e6789fb079fcbc209ed5d074a77f3587cc Reviewed-on: https://skia-review.googlesource.com/6092 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Mike Reed <reed@google.com>
* remove lots of legacy flagsGravatar Mike Reed2016-10-31
| | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4209 Change-Id: I49ae36a9b2bb51a6470638d3264923ff4a4dea0a Reviewed-on: https://skia-review.googlesource.com/4209 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* SkFontData to use smart pointers.Gravatar bungeman2016-09-16
| | | | | | | | | | | | | | | | | The SkFontData type is not exposed externally, so any method which uses it can be updated to use smart pointers without affecting external users. Updating this first will make updating the public API much easier. This also updates SkStreamAsset* SkStream::NewFromFile(const char*) to std::unique_ptr<SkStreamAsset> SkStream::MakeFromFile(const char*). It appears that no one outside Skia is currently using SkStream::NewfromFile so this is a good time to update it as well. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2339273002 Committed: https://skia.googlesource.com/skia/+/d8c2476a8b1e1e1a1771b17e8dd4db8645914f8c Review-Url: https://codereview.chromium.org/2339273002
* Revert of SkFontData to use smart pointers. (patchset #3 id:40001 of ↵Gravatar bungeman2016-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/2339273002/ ) Reason for revert: Killing Mac Original issue's description: > SkFontData to use smart pointers. > > The SkFontData type is not exposed externally, so any method which uses > it can be updated to use smart pointers without affecting external > users. Updating this first will make updating the public API much > easier. > > This also updates SkStreamAsset* SkStream::NewFromFile(const char*) to > std::unique_ptr<SkStreamAsset> SkStream::MakeFromFile(const char*). It > appears that no one outside Skia is currently using SkStream::NewfromFile > so this is a good time to update it as well. > > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2339273002 > > Committed: https://skia.googlesource.com/skia/+/d8c2476a8b1e1e1a1771b17e8dd4db8645914f8c TBR=mtklein@chromium.org,halcanary@google.com,mtklein@google.com,reed@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review-Url: https://codereview.chromium.org/2343933002
* SkFontData to use smart pointers.Gravatar bungeman2016-09-15
| | | | | | | | | | | | | | | | The SkFontData type is not exposed externally, so any method which uses it can be updated to use smart pointers without affecting external users. Updating this first will make updating the public API much easier. This also updates SkStreamAsset* SkStream::NewFromFile(const char*) to std::unique_ptr<SkStreamAsset> SkStream::MakeFromFile(const char*). It appears that no one outside Skia is currently using SkStream::NewfromFile so this is a good time to update it as well. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2339273002 Review-Url: https://codereview.chromium.org/2339273002
* change SkStreams to work with sk_sp<SkData> instead of SkData*Gravatar reed2016-09-12
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2333713002 Review-Url: https://codereview.chromium.org/2333713002
* SkWStream::writeText inlined.Gravatar halcanary2016-04-11
| | | | | | | | | | | | | | | | | | | | | | | | | | Motivation: This function is used throughout SkPDF. Note that the compiler can usually inline the result of strlen() for literal strings. Before: out/Release/nanobench -m WStreamWriteText -q Timer overhead: 24.2ns ! -> high variance, ? -> moderate variance micros bench 6.10 WStreamWriteText nonrendering After: out/Release/nanobench -m WStreamWriteText -q Timer overhead: 23.9ns ! -> high variance, ? -> moderate variance micros bench 2.51 WStreamWriteText nonrendering PDF runtime change: -0.8% ±0.04%. GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1844343004 Review URL: https://codereview.chromium.org/1844343004
* add missing APIGravatar caryclark2016-03-16
| | | | | | | | | SkMemoryWStream needs SK_API to be accessible from PDFium. R=reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1808683002 Review URL: https://codereview.chromium.org/1808683002
* Make sp variants for SkDataGravatar reed2016-03-11
| | | | Review URL: https://codereview.chromium.org/1779263003
* add fsync to try to get complete skps from webpage picture captureGravatar caryclark2015-12-16
| | | | | | | | R=reed@google.com,mtklein@google.com BUG=skia:4691 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1530783003 Review URL: https://codereview.chromium.org/1530783003
* Allow SkStream::peek() to partially succeedGravatar scroggo2015-12-07
| | | | | | | | | | | | | | | | | | | | If the stream can peek less than requested, peek that amount. Return the number of bytes peeked. This simplifies crrev.com/1472123002. For a stream that is smaller than 14 bytes, it can successfully peek, meaning the client will not need to fall back to read() + rewind(), which may fail if the stream can peek but not rewind. This CL revives code from patch set 3 of crrev.com/1044953002, where I initially introduced peek() (including tests). Add a test for SkFrontBufferedStream that verifies that peeking does not make rewind() fail (i.e. by reading past the internal buffer). BUG=skia:3257 Review URL: https://codereview.chromium.org/1490923005
* Eliminate SkFILE: it always is the same as FILE.Gravatar halcanary2015-11-20
| | | | Review URL: https://codereview.chromium.org/1467533003
* 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
* Add a method to read a stream without advancing it.Gravatar scroggo2015-04-02
| | | | | | | | | | | | | | | | | | | | | Add a virtual method on SkStream which will do a "peek" some bytes, so that those bytes are read, but the next call to read will be unaffected. Implement peek for SkMemoryStream, where the implementation is simple and obvious. Implement peek on SkFrontBufferedStream. Add tests. Motivated by decoding streams which cannot be rewound. TBR=reed@google.com BUG=skia:3257 Review URL: https://codereview.chromium.org/1044953002
* Remove SkMemoryStream::peek()Gravatar scroggo2015-03-27
| | | | | | | | | | | | | | | | | | | | | | | | I'd like to add a new API to SkStream for peeking - i.e. reading some bytes without advancing the stream. This will be implemented for the streams where it makes sense. I think the function should look something like the following: size_t peek(void* buffer, size_t bytesToRead) { return this->onPeek(buffer, bytesToRead); } virtual size_t onPeek(void* buffer, size_t bytesToRead) { return 0; // unimplemented base class. } In order to avoid confusion, I'd like to remove SkMemoryStream::peek(), which is not currently used internally, by Chrome, or by Android as far as I can tell. There is also another function does the same thing: getPosition(). BUG=skia:3257 Review URL: https://codereview.chromium.org/1039373002
* C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla}Gravatar mtklein2015-03-25
| | | | | | | | | NOPRESUBMIT=true BUG=skia: DOCS_PREVIEW= https://skia.org/?cl=1037793002 Review URL: https://codereview.chromium.org/1037793002
* SkStream: Add SkDynamicMemoryWStream::writeToStream(SkWStream*)Gravatar halcanary2015-02-23
| | | | Review URL: https://codereview.chromium.org/943423002
* 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
* 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
* Simplify SkInstCntGravatar mtklein2015-01-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This code requires fewer macros to use it (just one), has less code in macro definitions, and has simpler synchronization code (just atomic ints, no SkOnce, no SkMutex, etc.) A minor downside, we lose indentation and reverse-ordering in the final report: Leaked SkRefCntBase: 7 Leaked SkFontMgr: 1 Leaked SkWeakRefCnt: 1 Leaked SkTypeface: 1 Leaked SkFlattenable: 3 Leaked SkXfermode: 3 Leaked SkPathRef: 1 Leaked SkPixelRef: 1 Leaked SkMallocPixelRef: 1 becomes Leaked SkXfermode: 3 Leaked SkMallocPixelRef: 1 Leaked SkPixelRef: 1 Leaked SkPathRef: 1 Leaked SkFlattenable: 3 Leaked SkTypeface: 1 Leaked SkWeakRefCnt: 1 Leaked SkFontMgr: 1 Leaked SkRefCntBase: 7 This is motivated by wanting to land https://codereview.chromium.org/806473006/, which makes sure all static use of SkOnce are in global scope. The current implementation of SkInstCnt uses them in function scope, which isn't safe. BUG=skia: No public API changes. TBR=reed@google.com Review URL: https://codereview.chromium.org/841263004
* Fix up all the easy virtual ... SK_OVERRIDE cases.Gravatar mtklein2015-01-09
| | | | | | | | | | | | This fixes every case where virtual and SK_OVERRIDE were on the same line, which should be the bulk of cases. We'll have to manually clean up the rest over time unless I level up in regexes. for f in (find . -type f); perl -p -i -e 's/virtual (.*)SK_OVERRIDE/\1SK_OVERRIDE/g' $f; end BUG=skia: Review URL: https://codereview.chromium.org/806653007
* 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
* remove confusing/unused stream methodsGravatar reed2014-09-12
| | | | | | | | | BUG=skia: R=bungeman@google.com, djsollen@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/563273003
* Add size_t bytesWritten() const to SkWStream.Gravatar commit-bot@chromium.org2014-03-06
| | | | | | | | | | | BUG=skia: R=reed@google.com, mtklein@google.com, robertphillips@google.com, bungeman@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/187653003 git-svn-id: http://skia.googlecode.com/svn/trunk@13684 2bbb7eff-a529-9590-31e7-b0007b416f81