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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 fBitmap.lockPixels(); | 120 fBitmap.lockPixels(); |
121 } | 121 } |
122 } | 122 } |
123 | 123 |
124 void SkBitmapDevice::unlockPixels() { | 124 void SkBitmapDevice::unlockPixels() { |
125 if (fBitmap.lockPixelsAreWritable()) { | 125 if (fBitmap.lockPixelsAreWritable()) { |
126 fBitmap.unlockPixels(); | 126 fBitmap.unlockPixels(); |
127 } | 127 } |
128 } | 128 } |
129 | 129 |
130 void SkBitmapDevice::clear(SkColor color) { | |
131 fBitmap.eraseColor(color); | |
132 } | |
133 | |
134 const SkBitmap& SkBitmapDevice::onAccessBitmap() { | 130 const SkBitmap& SkBitmapDevice::onAccessBitmap() { |
135 return fBitmap; | 131 return fBitmap; |
136 } | 132 } |
137 | 133 |
138 void* SkBitmapDevice::onAccessPixels(SkImageInfo* info, size_t* rowBytes) { | 134 void* SkBitmapDevice::onAccessPixels(SkImageInfo* info, size_t* rowBytes) { |
139 if (fBitmap.getPixels()) { | 135 if (fBitmap.getPixels()) { |
140 *info = fBitmap.info(); | 136 *info = fBitmap.info(); |
141 *rowBytes = fBitmap.rowBytes(); | 137 *rowBytes = fBitmap.rowBytes(); |
142 return fBitmap.getPixels(); | 138 return fBitmap.getPixels(); |
143 } | 139 } |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 paint.getRasterizer() || | 383 paint.getRasterizer() || |
388 paint.getPathEffect() || | 384 paint.getPathEffect() || |
389 paint.isFakeBoldText() || | 385 paint.isFakeBoldText() || |
390 paint.getStyle() != SkPaint::kFill_Style || | 386 paint.getStyle() != SkPaint::kFill_Style || |
391 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) | 387 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) |
392 { | 388 { |
393 return true; | 389 return true; |
394 } | 390 } |
395 return false; | 391 return false; |
396 } | 392 } |
OLD | NEW |