| 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 "SkShader.h" | 13 #include "SkShader.h" |
| 14 #include "SkTextBlob.h" | 14 #include "SkTextBlob.h" |
| 15 | 15 |
| 16 SkBaseDevice::SkBaseDevice() | 16 SkBaseDevice::SkBaseDevice() |
| 17 : fLeakyProperties(SkNEW_ARGS(SkDeviceProperties, (SkDeviceProperties::MakeD
efault()))) | 17 : fLeakyProperties(SkNEW_ARGS(SkDeviceProperties, (SkDeviceProperties::kLega
cyLCD_InitType))) |
| 18 #ifdef SK_DEBUG | 18 #ifdef SK_DEBUG |
| 19 , fAttachedToCanvas(false) | 19 , fAttachedToCanvas(false) |
| 20 #endif | 20 #endif |
| 21 { | 21 { |
| 22 fOrigin.setZero(); | 22 fOrigin.setZero(); |
| 23 fMetaData = NULL; | 23 fMetaData = NULL; |
| 24 } | 24 } |
| 25 | 25 |
| 26 SkBaseDevice::~SkBaseDevice() { | 26 SkBaseDevice::~SkBaseDevice() { |
| 27 SkDELETE(fLeakyProperties); | 27 SkDELETE(fLeakyProperties); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 50 } | 50 } |
| 51 | 51 |
| 52 const SkBitmap& SkBaseDevice::accessBitmap(bool changePixels) { | 52 const SkBitmap& SkBaseDevice::accessBitmap(bool changePixels) { |
| 53 const SkBitmap& bitmap = this->onAccessBitmap(); | 53 const SkBitmap& bitmap = this->onAccessBitmap(); |
| 54 if (changePixels) { | 54 if (changePixels) { |
| 55 bitmap.notifyPixelsChanged(); | 55 bitmap.notifyPixelsChanged(); |
| 56 } | 56 } |
| 57 return bitmap; | 57 return bitmap; |
| 58 } | 58 } |
| 59 | 59 |
| 60 SkSurface* SkBaseDevice::newSurface(const SkImageInfo&) { return NULL; } | 60 void SkBaseDevice::setPixelGeometry(SkPixelGeometry geo) { |
| 61 fLeakyProperties->fPixelGeometry = geo; |
| 62 } |
| 63 |
| 64 SkSurface* SkBaseDevice::newSurface(const SkImageInfo&, const SkSurfaceProps&) {
return NULL; } |
| 61 | 65 |
| 62 const void* SkBaseDevice::peekPixels(SkImageInfo*, size_t*) { return NULL; } | 66 const void* SkBaseDevice::peekPixels(SkImageInfo*, size_t*) { return NULL; } |
| 63 | 67 |
| 64 void SkBaseDevice::drawDRRect(const SkDraw& draw, const SkRRect& outer, | 68 void SkBaseDevice::drawDRRect(const SkDraw& draw, const SkRRect& outer, |
| 65 const SkRRect& inner, const SkPaint& paint) { | 69 const SkRRect& inner, const SkPaint& paint) { |
| 66 SkPath path; | 70 SkPath path; |
| 67 path.addRRect(outer); | 71 path.addRRect(outer); |
| 68 path.addRRect(inner); | 72 path.addRRect(inner); |
| 69 path.setFillType(SkPath::kEvenOdd_FillType); | 73 path.setFillType(SkPath::kEvenOdd_FillType); |
| 70 | 74 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 | 198 |
| 195 void SkBaseDevice::EXPERIMENTAL_optimize(const SkPicture* picture) { | 199 void SkBaseDevice::EXPERIMENTAL_optimize(const SkPicture* picture) { |
| 196 // The base class doesn't perform any analysis but derived classes may | 200 // The base class doesn't perform any analysis but derived classes may |
| 197 } | 201 } |
| 198 | 202 |
| 199 bool SkBaseDevice::EXPERIMENTAL_drawPicture(SkCanvas*, const SkPicture*, const S
kMatrix*, | 203 bool SkBaseDevice::EXPERIMENTAL_drawPicture(SkCanvas*, const SkPicture*, const S
kMatrix*, |
| 200 const SkPaint*) { | 204 const SkPaint*) { |
| 201 // The base class doesn't perform any accelerated picture rendering | 205 // The base class doesn't perform any accelerated picture rendering |
| 202 return false; | 206 return false; |
| 203 } | 207 } |
| OLD | NEW |