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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 } | 110 } |
111 | 111 |
112 void SkBitmapDevice::replaceBitmapBackendForRasterSurface(const SkBitmap& bm) { | 112 void SkBitmapDevice::replaceBitmapBackendForRasterSurface(const SkBitmap& bm) { |
113 SkASSERT(bm.width() == fBitmap.width()); | 113 SkASSERT(bm.width() == fBitmap.width()); |
114 SkASSERT(bm.height() == fBitmap.height()); | 114 SkASSERT(bm.height() == fBitmap.height()); |
115 fBitmap = bm; // intent is to use bm's pixelRef (and rowbytes/config) | 115 fBitmap = bm; // intent is to use bm's pixelRef (and rowbytes/config) |
116 fBitmap.lockPixels(); | 116 fBitmap.lockPixels(); |
117 } | 117 } |
118 | 118 |
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 const 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 if (fBitmap.lockPixelsAreWritable() && this->onPeekPixels(pmap)) { | 129 if (fBitmap.lockPixelsAreWritable() && this->onPeekPixels(pmap)) { |
130 fBitmap.notifyPixelsChanged(); | 130 fBitmap.notifyPixelsChanged(); |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 paint.getRasterizer() || | 375 paint.getRasterizer() || |
376 paint.getPathEffect() || | 376 paint.getPathEffect() || |
377 paint.isFakeBoldText() || | 377 paint.isFakeBoldText() || |
378 paint.getStyle() != SkPaint::kFill_Style || | 378 paint.getStyle() != SkPaint::kFill_Style || |
379 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) | 379 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) |
380 { | 380 { |
381 return true; | 381 return true; |
382 } | 382 } |
383 return false; | 383 return false; |
384 } | 384 } |
OLD | NEW |