| 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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 SkPath path; | 225 SkPath path; |
| 226 path.addOval(oval); | 226 path.addOval(oval); |
| 227 // call the VIRTUAL version, so any subclasses who do handle drawPath aren't | 227 // call the VIRTUAL version, so any subclasses who do handle drawPath aren't |
| 228 // required to override drawOval. | 228 // required to override drawOval. |
| 229 this->drawPath(draw, path, paint, NULL, true); | 229 this->drawPath(draw, path, paint, NULL, true); |
| 230 } | 230 } |
| 231 | 231 |
| 232 void SkBitmapDevice::drawRRect(const SkDraw& draw, const SkRRect& rrect, const S
kPaint& paint) { | 232 void SkBitmapDevice::drawRRect(const SkDraw& draw, const SkRRect& rrect, const S
kPaint& paint) { |
| 233 CHECK_FOR_ANNOTATION(paint); | 233 CHECK_FOR_ANNOTATION(paint); |
| 234 | 234 |
| 235 #ifdef SK_IGNORE_BLURRED_RRECT_OPT |
| 236 SkPath path; |
| 237 |
| 238 path.addRRect(rrect); |
| 239 // call the VIRTUAL version, so any subclasses who do handle drawPath aren't |
| 240 // required to override drawRRect. |
| 241 this->drawPath(draw, path, paint, NULL, true); |
| 242 #else |
| 235 draw.drawRRect(rrect, paint); | 243 draw.drawRRect(rrect, paint); |
| 244 #endif |
| 236 } | 245 } |
| 237 | 246 |
| 238 void SkBitmapDevice::drawPath(const SkDraw& draw, const SkPath& path, | 247 void SkBitmapDevice::drawPath(const SkDraw& draw, const SkPath& path, |
| 239 const SkPaint& paint, const SkMatrix* prePathMatri
x, | 248 const SkPaint& paint, const SkMatrix* prePathMatri
x, |
| 240 bool pathIsMutable) { | 249 bool pathIsMutable) { |
| 241 CHECK_FOR_ANNOTATION(paint); | 250 CHECK_FOR_ANNOTATION(paint); |
| 242 draw.drawPath(path, paint, prePathMatrix, pathIsMutable); | 251 draw.drawPath(path, paint, prePathMatrix, pathIsMutable); |
| 243 } | 252 } |
| 244 | 253 |
| 245 void SkBitmapDevice::drawBitmap(const SkDraw& draw, const SkBitmap& bitmap, | 254 void SkBitmapDevice::drawBitmap(const SkDraw& draw, const SkBitmap& bitmap, |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 paint.getStyle() != SkPaint::kFill_Style || | 405 paint.getStyle() != SkPaint::kFill_Style || |
| 397 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) { | 406 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) { |
| 398 // turn off lcd | 407 // turn off lcd |
| 399 flags->fFlags = paint.getFlags() & ~SkPaint::kLCDRenderText_Flag; | 408 flags->fFlags = paint.getFlags() & ~SkPaint::kLCDRenderText_Flag; |
| 400 flags->fHinting = paint.getHinting(); | 409 flags->fHinting = paint.getHinting(); |
| 401 return true; | 410 return true; |
| 402 } | 411 } |
| 403 // we're cool with the paint as is | 412 // we're cool with the paint as is |
| 404 return false; | 413 return false; |
| 405 } | 414 } |
| OLD | NEW |