aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkBitmap.h
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2015-12-14 10:19:17 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-12-14 10:19:17 -0800
commit023bda0d836834eb1f98ceec15b169a492ab78ad (patch)
tree1dc817f5fa326a6bb943aa1bb10f3ac1e6714ede /include/core/SkBitmap.h
parentc9730831fcff6016279b304f246740b3cf53f9e4 (diff)
SkBitmap move
Running `Release/dm --gpu 0`, the number of times we call SkBitmap::operator=(const SkBitmap&) (which refs the pixelref) is reduced from ~214929 to ~214626. Review URL: https://codereview.chromium.org/1514503004
Diffstat (limited to 'include/core/SkBitmap.h')
-rw-r--r--include/core/SkBitmap.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h
index cf1c4c77f2..a81e03eefa 100644
--- a/include/core/SkBitmap.h
+++ b/include/core/SkBitmap.h
@@ -54,12 +54,24 @@ public:
*/
SkBitmap(const SkBitmap& src);
+ /**
+ * Copy the settings from the src into this bitmap. If the src has pixels
+ * allocated, ownership of the pixels will be taken.
+ */
+ SkBitmap(SkBitmap&& src);
+
~SkBitmap();
- /** Copies the src bitmap into this bitmap. Ownership of the src bitmap's pixels remains
- with the src bitmap.
+ /** Copies the src bitmap into this bitmap. Ownership of the src
+ bitmap's pixels is shared with the src bitmap.
*/
SkBitmap& operator=(const SkBitmap& src);
+
+ /** Copies the src bitmap into this bitmap. Takes ownership of the src
+ bitmap's pixels.
+ */
+ SkBitmap& operator=(SkBitmap&& src);
+
/** Swap the fields of the two bitmaps. This routine is guaranteed to never fail or throw.
*/
// This method is not exported to java.