OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2008 The Android Open Source Project | 3 * Copyright 2008 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
(...skipping 1370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1381 f
PixelRefOrigin.y(), | 1381 f
PixelRefOrigin.y(), |
1382 r
es.fRowBytes); | 1382 r
es.fRowBytes); |
1383 | 1383 |
1384 result->reset(SkPixmap(this->info(), addr, res.fRowBytes, res.fCTable), | 1384 result->reset(SkPixmap(this->info(), addr, res.fRowBytes, res.fCTable), |
1385 res.fUnlockProc, res.fUnlockContext); | 1385 res.fUnlockProc, res.fUnlockContext); |
1386 return true; | 1386 return true; |
1387 } | 1387 } |
1388 return false; | 1388 return false; |
1389 } | 1389 } |
1390 | 1390 |
| 1391 bool SkBitmap::peekPixels(SkPixmap* pmap) const { |
| 1392 if (fPixels) { |
| 1393 if (pmap) { |
| 1394 pmap->reset(fInfo, fPixels, fRowBytes, fColorTable); |
| 1395 } |
| 1396 return true; |
| 1397 } |
| 1398 return false; |
| 1399 } |
| 1400 |
1391 /////////////////////////////////////////////////////////////////////////////// | 1401 /////////////////////////////////////////////////////////////////////////////// |
1392 | 1402 |
1393 #ifdef SK_DEBUG | 1403 #ifdef SK_DEBUG |
1394 void SkImageInfo::validate() const { | 1404 void SkImageInfo::validate() const { |
1395 SkASSERT(fWidth >= 0); | 1405 SkASSERT(fWidth >= 0); |
1396 SkASSERT(fHeight >= 0); | 1406 SkASSERT(fHeight >= 0); |
1397 SkASSERT(SkColorTypeIsValid(fColorType)); | 1407 SkASSERT(SkColorTypeIsValid(fColorType)); |
1398 SkASSERT(SkAlphaTypeIsValid(fAlphaType)); | 1408 SkASSERT(SkAlphaTypeIsValid(fAlphaType)); |
1399 } | 1409 } |
1400 #endif | 1410 #endif |
OLD | NEW |