aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Eric Karl <ericrk@chromium.org>2017-06-12 10:05:49 -0700
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-12 18:27:48 +0000
commit7a8c84c6c92565842aeea27d4971fbd78d523f7a (patch)
tree703d50fbd35830c529db5ed97388503189135360 /src/core
parenta8d45e522097d4efe3b12bc26158870bd76299b7 (diff)
Reland DeferredTextureImageData low-bit-depth/dithering support
Cause DeferredTextureImageData functionality to support low bit depth (4444, 565) image formats (with dithering). Updated to handle colorspace + 4444 colortype correctly. Bug: 720105 Change-Id: Ib7e14d937849f4f6b08fda6992a240bb203d0089 Reviewed-on: https://skia-review.googlesource.com/19094 Commit-Queue: Eric Karl <ericrk@chromium.org> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/SkAutoPixmapStorage.cpp10
-rw-r--r--src/core/SkAutoPixmapStorage.h5
2 files changed, 15 insertions, 0 deletions
diff --git a/src/core/SkAutoPixmapStorage.cpp b/src/core/SkAutoPixmapStorage.cpp
index 865b3a6029..5ad19390c6 100644
--- a/src/core/SkAutoPixmapStorage.cpp
+++ b/src/core/SkAutoPixmapStorage.cpp
@@ -14,6 +14,16 @@ SkAutoPixmapStorage::~SkAutoPixmapStorage() {
this->freeStorage();
}
+SkAutoPixmapStorage& SkAutoPixmapStorage::operator=(SkAutoPixmapStorage&& other) {
+ this->fStorage = other.fStorage;
+ this->INHERITED::reset(other.info(), this->fStorage, other.rowBytes(), other.ctable());
+
+ other.fStorage = nullptr;
+ other.INHERITED::reset();
+
+ return *this;
+}
+
size_t SkAutoPixmapStorage::AllocSize(const SkImageInfo& info, size_t* rowBytes) {
size_t rb = info.minRowBytes();
if (rowBytes) {
diff --git a/src/core/SkAutoPixmapStorage.h b/src/core/SkAutoPixmapStorage.h
index 66c5655e54..6342a41deb 100644
--- a/src/core/SkAutoPixmapStorage.h
+++ b/src/core/SkAutoPixmapStorage.h
@@ -17,6 +17,11 @@ public:
~SkAutoPixmapStorage();
/**
+ * Leave the moved-from object in a free-but-valid state.
+ */
+ SkAutoPixmapStorage& operator=(SkAutoPixmapStorage&& other);
+
+ /**
* 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.