aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkPixmap.h
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2016-03-16 09:47:08 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-16 09:47:08 -0700
commit250581493a0859987e482810879e85e5ac2dc002 (patch)
tree2a9432c347327c16d35a15f6a6b8b53b7704aef3 /include/core/SkPixmap.h
parentb3b6beae044ca457edf99cf223cd6379a49d4ef0 (diff)
Add SkSpecialImage::extractSubset & NewFromPixmap
This is calved off of: https://codereview.chromium.org/1785643003/ (Switch SkBlurImageFilter over to new onFilterImage interface) GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1787883002 Review URL: https://codereview.chromium.org/1787883002
Diffstat (limited to 'include/core/SkPixmap.h')
-rw-r--r--include/core/SkPixmap.h65
1 files changed, 0 insertions, 65 deletions
diff --git a/include/core/SkPixmap.h b/include/core/SkPixmap.h
index b43072b957..3a7abdf134 100644
--- a/include/core/SkPixmap.h
+++ b/include/core/SkPixmap.h
@@ -187,71 +187,6 @@ private:
/////////////////////////////////////////////////////////////////////////////////////////////
-class SK_API SkAutoPixmapStorage : public SkPixmap {
-public:
- SkAutoPixmapStorage();
- ~SkAutoPixmapStorage();
-
- /**
- * Try to allocate memory for the pixels needed to match the specified Info. On success
- * return true and fill out the pixmap to point to that memory. The storage will be freed
- * when this object is destroyed, or if another call to tryAlloc() or alloc() is made.
- *
- * On failure, return false and reset() the pixmap to empty.
- */
- bool tryAlloc(const SkImageInfo&);
-
- /**
- * Allocate memory for the pixels needed to match the specified Info and fill out the pixmap
- * to point to that memory. The storage will be freed when this object is destroyed,
- * or if another call to tryAlloc() or alloc() is made.
- *
- * If the memory cannot be allocated, calls sk_throw().
- */
- void alloc(const SkImageInfo&);
-
- /**
- * Gets the size and optionally the rowBytes that would be allocated by SkAutoPixmapStorage if
- * alloc/tryAlloc was called.
- */
- static size_t AllocSize(const SkImageInfo& info, size_t* rowBytes);
-
- /**
- * Returns an SkData object wrapping the allocated pixels memory, and resets the pixmap.
- * If the storage hasn't been allocated, the result is NULL.
- */
- const SkData* SK_WARN_UNUSED_RESULT detachPixelsAsData();
-
- // We wrap these so we can clear our internal storage
-
- void reset() {
- this->freeStorage();
- this->INHERITED::reset();
- }
- void reset(const SkImageInfo& info, const void* addr, size_t rb, SkColorTable* ctable = NULL) {
- this->freeStorage();
- this->INHERITED::reset(info, addr, rb, ctable);
- }
- void reset(const SkImageInfo& info) {
- this->freeStorage();
- this->INHERITED::reset(info);
- }
- bool SK_WARN_UNUSED_RESULT reset(const SkMask& mask) {
- this->freeStorage();
- return this->INHERITED::reset(mask);
- }
-
-private:
- void* fStorage;
-
- void freeStorage() {
- sk_free(fStorage);
- fStorage = nullptr;
- }
-
- typedef SkPixmap INHERITED;
-};
-
/////////////////////////////////////////////////////////////////////////////////////////////
class SK_API SkAutoPixmapUnlock : ::SkNoncopyable {