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 |
80 void SkBitmapDevice::clear(SkColor color) { | 88 void SkBitmapDevice::clear(SkColor color) { |
81 fBitmap.eraseColor(color); | 89 fBitmap.eraseColor(color); |
82 } | 90 } |
83 | 91 |
84 const SkBitmap& SkBitmapDevice::onAccessBitmap() { | 92 const SkBitmap& SkBitmapDevice::onAccessBitmap() { |
85 return fBitmap; | 93 return fBitmap; |
86 } | 94 } |
87 | 95 |
88 bool SkBitmapDevice::canHandleImageFilter(SkImageFilter*) { | 96 bool SkBitmapDevice::canHandleImageFilter(SkImageFilter*) { |
89 return false; | 97 return false; |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 paint.getStyle() != SkPaint::kFill_Style || | 405 paint.getStyle() != SkPaint::kFill_Style || |
398 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) { | 406 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) { |
399 // turn off lcd | 407 // turn off lcd |
400 flags->fFlags = paint.getFlags() & ~SkPaint::kLCDRenderText_Flag; | 408 flags->fFlags = paint.getFlags() & ~SkPaint::kLCDRenderText_Flag; |
401 flags->fHinting = paint.getHinting(); | 409 flags->fHinting = paint.getHinting(); |
402 return true; | 410 return true; |
403 } | 411 } |
404 // we're cool with the paint as is | 412 // we're cool with the paint as is |
405 return false; | 413 return false; |
406 } | 414 } |
OLD | NEW |