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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 paint.getStyle() != SkPaint::kFill_Style || | 397 paint.getStyle() != SkPaint::kFill_Style || |
406 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) { | 398 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) { |
407 // turn off lcd | 399 // turn off lcd |
408 flags->fFlags = paint.getFlags() & ~SkPaint::kLCDRenderText_Flag; | 400 flags->fFlags = paint.getFlags() & ~SkPaint::kLCDRenderText_Flag; |
409 flags->fHinting = paint.getHinting(); | 401 flags->fHinting = paint.getHinting(); |
410 return true; | 402 return true; |
411 } | 403 } |
412 // we're cool with the paint as is | 404 // we're cool with the paint as is |
413 return false; | 405 return false; |
414 } | 406 } |
OLD | NEW |