Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1047)

Side by Side Diff: include/core/SkBitmap.h

Issue 1514503004: SkBitmap move (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-12-14 (Monday) 12:58:31 EST Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/core/SkBitmap.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkBitmap_DEFINED 8 #ifndef SkBitmap_DEFINED
9 #define SkBitmap_DEFINED 9 #define SkBitmap_DEFINED
10 10
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 /** 48 /**
49 * Copy the settings from the src into this bitmap. If the src has pixels 49 * Copy the settings from the src into this bitmap. If the src has pixels
50 * allocated, they will be shared, not copied, so that the two bitmaps will 50 * allocated, they will be shared, not copied, so that the two bitmaps will
51 * reference the same memory for the pixels. If a deep copy is needed, 51 * reference the same memory for the pixels. If a deep copy is needed,
52 * where the new bitmap has its own separate copy of the pixels, use 52 * where the new bitmap has its own separate copy of the pixels, use
53 * deepCopyTo(). 53 * deepCopyTo().
54 */ 54 */
55 SkBitmap(const SkBitmap& src); 55 SkBitmap(const SkBitmap& src);
56 56
57 /**
58 * Copy the settings from the src into this bitmap. If the src has pixels
59 * allocated, ownership of the pixels will be taken.
60 */
61 SkBitmap(SkBitmap&& src);
62
57 ~SkBitmap(); 63 ~SkBitmap();
58 64
59 /** Copies the src bitmap into this bitmap. Ownership of the src bitmap's pi xels remains 65 /** Copies the src bitmap into this bitmap. Ownership of the src
60 with the src bitmap. 66 bitmap's pixels is shared with the src bitmap.
61 */ 67 */
62 SkBitmap& operator=(const SkBitmap& src); 68 SkBitmap& operator=(const SkBitmap& src);
69
70 /** Copies the src bitmap into this bitmap. Takes ownership of the src
71 bitmap's pixels.
72 */
73 SkBitmap& operator=(SkBitmap&& src);
74
63 /** Swap the fields of the two bitmaps. This routine is guaranteed to never fail or throw. 75 /** Swap the fields of the two bitmaps. This routine is guaranteed to never fail or throw.
64 */ 76 */
65 // This method is not exported to java. 77 // This method is not exported to java.
66 void swap(SkBitmap& other); 78 void swap(SkBitmap& other);
67 79
68 /////////////////////////////////////////////////////////////////////////// 80 ///////////////////////////////////////////////////////////////////////////
69 81
70 const SkImageInfo& info() const { return fInfo; } 82 const SkImageInfo& info() const { return fInfo; }
71 83
72 int width() const { return fInfo.width(); } 84 int width() const { return fInfo.width(); }
(...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 825
814 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const { 826 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const {
815 SkASSERT(fPixels); 827 SkASSERT(fPixels);
816 SkASSERT(kIndex_8_SkColorType == this->colorType()); 828 SkASSERT(kIndex_8_SkColorType == this->colorType());
817 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th is->height()); 829 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th is->height());
818 SkASSERT(fColorTable); 830 SkASSERT(fColorTable);
819 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)]; 831 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)];
820 } 832 }
821 833
822 #endif 834 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkBitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698