| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkDevice.h" | 8 #include "SkDevice.h" |
| 9 #include "SkDeviceProperties.h" | 9 #include "SkDeviceProperties.h" |
| 10 #include "SkDraw.h" | 10 #include "SkDraw.h" |
| 11 #include "SkMetaData.h" | 11 #include "SkMetaData.h" |
| 12 #include "SkPatchUtils.h" | 12 #include "SkPatchUtils.h" |
| 13 #include "SkTextBlob.h" | 13 #include "SkTextBlob.h" |
| 14 | 14 |
| 15 SkBaseDevice::SkBaseDevice() | 15 SkBaseDevice::SkBaseDevice() |
| 16 : fLeakyProperties(SkNEW_ARGS(SkDeviceProperties, (SkDeviceProperties::MakeD
efault()))) | 16 : fLeakyProperties(SkNEW_ARGS(SkDeviceProperties, (SkDeviceProperties::kLega
cyLCD_InitType))) |
| 17 #ifdef SK_DEBUG | 17 #ifdef SK_DEBUG |
| 18 , fAttachedToCanvas(false) | 18 , fAttachedToCanvas(false) |
| 19 #endif | 19 #endif |
| 20 { | 20 { |
| 21 fOrigin.setZero(); | 21 fOrigin.setZero(); |
| 22 fMetaData = NULL; | 22 fMetaData = NULL; |
| 23 } | 23 } |
| 24 | 24 |
| 25 SkBaseDevice::~SkBaseDevice() { | 25 SkBaseDevice::~SkBaseDevice() { |
| 26 SkDELETE(fLeakyProperties); | 26 SkDELETE(fLeakyProperties); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 49 } | 49 } |
| 50 | 50 |
| 51 const SkBitmap& SkBaseDevice::accessBitmap(bool changePixels) { | 51 const SkBitmap& SkBaseDevice::accessBitmap(bool changePixels) { |
| 52 const SkBitmap& bitmap = this->onAccessBitmap(); | 52 const SkBitmap& bitmap = this->onAccessBitmap(); |
| 53 if (changePixels) { | 53 if (changePixels) { |
| 54 bitmap.notifyPixelsChanged(); | 54 bitmap.notifyPixelsChanged(); |
| 55 } | 55 } |
| 56 return bitmap; | 56 return bitmap; |
| 57 } | 57 } |
| 58 | 58 |
| 59 SkSurface* SkBaseDevice::newSurface(const SkImageInfo&) { return NULL; } | 59 void SkBaseDevice::setPixelGeometry(SkPixelGeometry geo) { |
| 60 fLeakyProperties->fPixelGeometry = geo; |
| 61 } |
| 62 |
| 63 SkSurface* SkBaseDevice::newSurface(const SkImageInfo&, const SkSurfaceProps&) {
return NULL; } |
| 60 | 64 |
| 61 const void* SkBaseDevice::peekPixels(SkImageInfo*, size_t*) { return NULL; } | 65 const void* SkBaseDevice::peekPixels(SkImageInfo*, size_t*) { return NULL; } |
| 62 | 66 |
| 63 void SkBaseDevice::drawDRRect(const SkDraw& draw, const SkRRect& outer, | 67 void SkBaseDevice::drawDRRect(const SkDraw& draw, const SkRRect& outer, |
| 64 const SkRRect& inner, const SkPaint& paint) { | 68 const SkRRect& inner, const SkPaint& paint) { |
| 65 SkPath path; | 69 SkPath path; |
| 66 path.addRRect(outer); | 70 path.addRRect(outer); |
| 67 path.addRRect(inner); | 71 path.addRRect(inner); |
| 68 path.setFillType(SkPath::kEvenOdd_FillType); | 72 path.setFillType(SkPath::kEvenOdd_FillType); |
| 69 | 73 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 | 184 |
| 181 void SkBaseDevice::EXPERIMENTAL_optimize(const SkPicture* picture) { | 185 void SkBaseDevice::EXPERIMENTAL_optimize(const SkPicture* picture) { |
| 182 // The base class doesn't perform any analysis but derived classes may | 186 // The base class doesn't perform any analysis but derived classes may |
| 183 } | 187 } |
| 184 | 188 |
| 185 bool SkBaseDevice::EXPERIMENTAL_drawPicture(SkCanvas*, const SkPicture*, const S
kMatrix*, | 189 bool SkBaseDevice::EXPERIMENTAL_drawPicture(SkCanvas*, const SkPicture*, const S
kMatrix*, |
| 186 const SkPaint*) { | 190 const SkPaint*) { |
| 187 // The base class doesn't perform any accelerated picture rendering | 191 // The base class doesn't perform any accelerated picture rendering |
| 188 return false; | 192 return false; |
| 189 } | 193 } |
| OLD | NEW |