diff options
author | 2014-02-17 21:21:46 +0000 | |
---|---|---|
committer | 2014-02-17 21:21:46 +0000 | |
commit | dac522589e9395b4654a1a708f1bd971f37f95a5 (patch) | |
tree | 3190dc309541bf8b706bee789b0a9ffce1771728 /src/core | |
parent | 5c056399259bb7ec06ff1eb8ce904001b363276c (diff) |
replace SkBitmap::Config with SkColorType in gms
add helper installMaskPixels() to SkBitmap
BUG=skia:
R=halcanary@google.com
Author: reed@google.com
Review URL: https://codereview.chromium.org/169913003
git-svn-id: http://skia.googlecode.com/svn/trunk@13482 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkBitmap.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp index 151ab50290..b6c2e2f65c 100644 --- a/src/core/SkBitmap.cpp +++ b/src/core/SkBitmap.cpp @@ -519,6 +519,16 @@ bool SkBitmap::installPixels(const SkImageInfo& info, void* pixels, size_t rb, return true; } +bool SkBitmap::installMaskPixels(const SkMask& mask) { + if (SkMask::kA8_Format != mask.fFormat) { + this->reset(); + return false; + } + return this->installPixels(SkImageInfo::MakeA8(mask.fBounds.width(), + mask.fBounds.height()), + mask.fImage, mask.fRowBytes); +} + bool SkBitmap::allocConfigPixels(Config config, int width, int height, bool isOpaque) { SkColorType ct; |