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::kLega
cyLCD_InitType))) | 17 : fLeakyProperties(SkNEW_ARGS(SkDeviceProperties, (SkDeviceProperties::MakeD
efault()))) |
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 void SkBaseDevice::setPixelGeometry(SkPixelGeometry geo) { | 60 SkSurface* SkBaseDevice::newSurface(const SkImageInfo&) { return NULL; } |
61 fLeakyProperties->fPixelGeometry = geo; | |
62 } | |
63 | |
64 SkSurface* SkBaseDevice::newSurface(const SkImageInfo&, const SkSurfaceProps&) {
return NULL; } | |
65 | 61 |
66 const void* SkBaseDevice::peekPixels(SkImageInfo*, size_t*) { return NULL; } | 62 const void* SkBaseDevice::peekPixels(SkImageInfo*, size_t*) { return NULL; } |
67 | 63 |
68 void SkBaseDevice::drawDRRect(const SkDraw& draw, const SkRRect& outer, | 64 void SkBaseDevice::drawDRRect(const SkDraw& draw, const SkRRect& outer, |
69 const SkRRect& inner, const SkPaint& paint) { | 65 const SkRRect& inner, const SkPaint& paint) { |
70 SkPath path; | 66 SkPath path; |
71 path.addRRect(outer); | 67 path.addRRect(outer); |
72 path.addRRect(inner); | 68 path.addRRect(inner); |
73 path.setFillType(SkPath::kEvenOdd_FillType); | 69 path.setFillType(SkPath::kEvenOdd_FillType); |
74 | 70 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 | 194 |
199 void SkBaseDevice::EXPERIMENTAL_optimize(const SkPicture* picture) { | 195 void SkBaseDevice::EXPERIMENTAL_optimize(const SkPicture* picture) { |
200 // The base class doesn't perform any analysis but derived classes may | 196 // The base class doesn't perform any analysis but derived classes may |
201 } | 197 } |
202 | 198 |
203 bool SkBaseDevice::EXPERIMENTAL_drawPicture(SkCanvas*, const SkPicture*, const S
kMatrix*, | 199 bool SkBaseDevice::EXPERIMENTAL_drawPicture(SkCanvas*, const SkPicture*, const S
kMatrix*, |
204 const SkPaint*) { | 200 const SkPaint*) { |
205 // The base class doesn't perform any accelerated picture rendering | 201 // The base class doesn't perform any accelerated picture rendering |
206 return false; | 202 return false; |
207 } | 203 } |
OLD | NEW |