| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 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 #include "SkBitmapDevice.h" | 8 #include "SkBitmapDevice.h" |
| 9 #include "SkConfig8888.h" | 9 #include "SkConfig8888.h" |
| 10 #include "SkDeviceProperties.h" | 10 #include "SkDeviceProperties.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 SkBaseDevice* SkBitmapDevice::onCreateDevice(const CreateInfo& cinfo, const SkPa
int*) { | 119 SkBaseDevice* SkBitmapDevice::onCreateDevice(const CreateInfo& cinfo, const SkPa
int*) { |
| 120 SkDeviceProperties leaky(cinfo.fPixelGeometry); | 120 SkDeviceProperties leaky(cinfo.fPixelGeometry); |
| 121 return SkBitmapDevice::Create(cinfo.fInfo, &leaky); | 121 return SkBitmapDevice::Create(cinfo.fInfo, &leaky); |
| 122 } | 122 } |
| 123 | 123 |
| 124 const SkBitmap& SkBitmapDevice::onAccessBitmap() { | 124 const SkBitmap& SkBitmapDevice::onAccessBitmap() { |
| 125 return fBitmap; | 125 return fBitmap; |
| 126 } | 126 } |
| 127 | 127 |
| 128 bool SkBitmapDevice::onAccessPixels(SkPixmap* pmap) { | 128 bool SkBitmapDevice::onAccessPixels(SkPixmap* pmap) { |
| 129 return fBitmap.lockPixelsAreWritable() && this->onPeekPixels(pmap); | 129 if (fBitmap.lockPixelsAreWritable() && this->onPeekPixels(pmap)) { |
| 130 fBitmap.notifyPixelsChanged(); |
| 131 return true; |
| 132 } |
| 133 return false; |
| 130 } | 134 } |
| 131 | 135 |
| 132 bool SkBitmapDevice::onPeekPixels(SkPixmap* pmap) { | 136 bool SkBitmapDevice::onPeekPixels(SkPixmap* pmap) { |
| 133 const SkImageInfo info = fBitmap.info(); | 137 const SkImageInfo info = fBitmap.info(); |
| 134 if (fBitmap.getPixels() && (kUnknown_SkColorType != info.colorType())) { | 138 if (fBitmap.getPixels() && (kUnknown_SkColorType != info.colorType())) { |
| 135 SkColorTable* ctable = NULL; | 139 SkColorTable* ctable = NULL; |
| 136 pmap->reset(fBitmap.info(), fBitmap.getPixels(), fBitmap.rowBytes(), cta
ble); | 140 pmap->reset(fBitmap.info(), fBitmap.getPixels(), fBitmap.rowBytes(), cta
ble); |
| 137 return true; | 141 return true; |
| 138 } | 142 } |
| 139 return false; | 143 return false; |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 paint.getRasterizer() || | 375 paint.getRasterizer() || |
| 372 paint.getPathEffect() || | 376 paint.getPathEffect() || |
| 373 paint.isFakeBoldText() || | 377 paint.isFakeBoldText() || |
| 374 paint.getStyle() != SkPaint::kFill_Style || | 378 paint.getStyle() != SkPaint::kFill_Style || |
| 375 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) | 379 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) |
| 376 { | 380 { |
| 377 return true; | 381 return true; |
| 378 } | 382 } |
| 379 return false; | 383 return false; |
| 380 } | 384 } |
| OLD | NEW |