| 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 "SkDraw.h" | 10 #include "SkDraw.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 } | 109 } |
| 110 | 110 |
| 111 void SkBitmapDevice::replaceBitmapBackendForRasterSurface(const SkBitmap& bm) { | 111 void SkBitmapDevice::replaceBitmapBackendForRasterSurface(const SkBitmap& bm) { |
| 112 SkASSERT(bm.width() == fBitmap.width()); | 112 SkASSERT(bm.width() == fBitmap.width()); |
| 113 SkASSERT(bm.height() == fBitmap.height()); | 113 SkASSERT(bm.height() == fBitmap.height()); |
| 114 fBitmap = bm; // intent is to use bm's pixelRef (and rowbytes/config) | 114 fBitmap = bm; // intent is to use bm's pixelRef (and rowbytes/config) |
| 115 fBitmap.lockPixels(); | 115 fBitmap.lockPixels(); |
| 116 } | 116 } |
| 117 | 117 |
| 118 SkBaseDevice* SkBitmapDevice::onCreateDevice(const CreateInfo& cinfo, const SkPa
int*) { | 118 SkBaseDevice* SkBitmapDevice::onCreateDevice(const CreateInfo& cinfo, const SkPa
int*) { |
| 119 const SkSurfaceProps leaky(0, cinfo.fPixelGeometry); | 119 const SkSurfaceProps surfaceProps(0, cinfo.fPixelGeometry); |
| 120 return SkBitmapDevice::Create(cinfo.fInfo, &leaky); | 120 return SkBitmapDevice::Create(cinfo.fInfo, &surfaceProps); |
| 121 } | 121 } |
| 122 | 122 |
| 123 const SkBitmap& SkBitmapDevice::onAccessBitmap() { | 123 const SkBitmap& SkBitmapDevice::onAccessBitmap() { |
| 124 return fBitmap; | 124 return fBitmap; |
| 125 } | 125 } |
| 126 | 126 |
| 127 bool SkBitmapDevice::onAccessPixels(SkPixmap* pmap) { | 127 bool SkBitmapDevice::onAccessPixels(SkPixmap* pmap) { |
| 128 if (fBitmap.lockPixelsAreWritable() && this->onPeekPixels(pmap)) { | 128 if (fBitmap.lockPixelsAreWritable() && this->onPeekPixels(pmap)) { |
| 129 fBitmap.notifyPixelsChanged(); | 129 fBitmap.notifyPixelsChanged(); |
| 130 return true; | 130 return true; |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 paint.getRasterizer() || | 374 paint.getRasterizer() || |
| 375 paint.getPathEffect() || | 375 paint.getPathEffect() || |
| 376 paint.isFakeBoldText() || | 376 paint.isFakeBoldText() || |
| 377 paint.getStyle() != SkPaint::kFill_Style || | 377 paint.getStyle() != SkPaint::kFill_Style || |
| 378 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) | 378 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) |
| 379 { | 379 { |
| 380 return true; | 380 return true; |
| 381 } | 381 } |
| 382 return false; | 382 return false; |
| 383 } | 383 } |
| OLD | NEW |