| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 fBitmap.lockPixels(); | 70 fBitmap.lockPixels(); |
| 71 } | 71 } |
| 72 } | 72 } |
| 73 | 73 |
| 74 void SkBitmapDevice::unlockPixels() { | 74 void SkBitmapDevice::unlockPixels() { |
| 75 if (fBitmap.lockPixelsAreWritable()) { | 75 if (fBitmap.lockPixelsAreWritable()) { |
| 76 fBitmap.unlockPixels(); | 76 fBitmap.unlockPixels(); |
| 77 } | 77 } |
| 78 } | 78 } |
| 79 | 79 |
| 80 void SkBitmapDevice::getGlobalBounds(SkIRect* bounds) const { | |
| 81 if (NULL != bounds) { | |
| 82 const SkIPoint& origin = this->getOrigin(); | |
| 83 bounds->setXYWH(origin.x(), origin.y(), | |
| 84 fBitmap.width(), fBitmap.height()); | |
| 85 } | |
| 86 } | |
| 87 | |
| 88 void SkBitmapDevice::clear(SkColor color) { | 80 void SkBitmapDevice::clear(SkColor color) { |
| 89 fBitmap.eraseColor(color); | 81 fBitmap.eraseColor(color); |
| 90 } | 82 } |
| 91 | 83 |
| 92 const SkBitmap& SkBitmapDevice::onAccessBitmap() { | 84 const SkBitmap& SkBitmapDevice::onAccessBitmap() { |
| 93 return fBitmap; | 85 return fBitmap; |
| 94 } | 86 } |
| 95 | 87 |
| 96 bool SkBitmapDevice::canHandleImageFilter(SkImageFilter*) { | 88 bool SkBitmapDevice::canHandleImageFilter(SkImageFilter*) { |
| 97 return false; | 89 return false; |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 paint.getStyle() != SkPaint::kFill_Style || | 389 paint.getStyle() != SkPaint::kFill_Style || |
| 398 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) { | 390 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) { |
| 399 // turn off lcd | 391 // turn off lcd |
| 400 flags->fFlags = paint.getFlags() & ~SkPaint::kLCDRenderText_Flag; | 392 flags->fFlags = paint.getFlags() & ~SkPaint::kLCDRenderText_Flag; |
| 401 flags->fHinting = paint.getHinting(); | 393 flags->fHinting = paint.getHinting(); |
| 402 return true; | 394 return true; |
| 403 } | 395 } |
| 404 // we're cool with the paint as is | 396 // we're cool with the paint as is |
| 405 return false; | 397 return false; |
| 406 } | 398 } |
| OLD | NEW |