| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 #include "SkDevice.h" | 8 #include "SkDevice.h" |
| 9 #include "SkDeviceProperties.h" | 9 #include "SkDeviceProperties.h" |
| 10 #include "SkDraw.h" | 10 #include "SkDraw.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 /////////////////////////////////////////////////////////////////////////////// | 25 /////////////////////////////////////////////////////////////////////////////// |
| 26 | 26 |
| 27 SkDevice::SkDevice(const SkBitmap& bitmap) | 27 SkDevice::SkDevice(const SkBitmap& bitmap) |
| 28 : fBitmap(bitmap), fLeakyProperties(SkDeviceProperties::MakeDefault()) | 28 : fBitmap(bitmap), fLeakyProperties(SkDeviceProperties::MakeDefault()) |
| 29 #ifdef SK_DEBUG | 29 #ifdef SK_DEBUG |
| 30 , fAttachedToCanvas(false) | 30 , fAttachedToCanvas(false) |
| 31 #endif | 31 #endif |
| 32 { | 32 { |
| 33 fOrigin.setZero(); | 33 fOrigin.setZero(); |
| 34 fMetaData = NULL; | 34 fMetaData = NULL; |
| 35 |
| 36 SkASSERT(SkBitmap::kARGB_4444_Config != bitmap.config()); |
| 35 } | 37 } |
| 36 | 38 |
| 37 SkDevice::SkDevice(const SkBitmap& bitmap, const SkDeviceProperties& devicePrope
rties) | 39 SkDevice::SkDevice(const SkBitmap& bitmap, const SkDeviceProperties& devicePrope
rties) |
| 38 : fBitmap(bitmap), fLeakyProperties(deviceProperties) | 40 : fBitmap(bitmap), fLeakyProperties(deviceProperties) |
| 39 #ifdef SK_DEBUG | 41 #ifdef SK_DEBUG |
| 40 , fAttachedToCanvas(false) | 42 , fAttachedToCanvas(false) |
| 41 #endif | 43 #endif |
| 42 { | 44 { |
| 43 fOrigin.setZero(); | 45 fOrigin.setZero(); |
| 44 fMetaData = NULL; | 46 fMetaData = NULL; |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 paint.getStyle() != SkPaint::kFill_Style || | 550 paint.getStyle() != SkPaint::kFill_Style || |
| 549 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) { | 551 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) { |
| 550 // turn off lcd | 552 // turn off lcd |
| 551 flags->fFlags = paint.getFlags() & ~SkPaint::kLCDRenderText_Flag; | 553 flags->fFlags = paint.getFlags() & ~SkPaint::kLCDRenderText_Flag; |
| 552 flags->fHinting = paint.getHinting(); | 554 flags->fHinting = paint.getHinting(); |
| 553 return true; | 555 return true; |
| 554 } | 556 } |
| 555 // we're cool with the paint as is | 557 // we're cool with the paint as is |
| 556 return false; | 558 return false; |
| 557 } | 559 } |
| OLD | NEW |