| 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 "SkMetaData.h" | 9 #include "SkMetaData.h" |
| 10 | 10 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 SkMetaData& SkBaseDevice::getMetaData() { | 43 SkMetaData& SkBaseDevice::getMetaData() { |
| 44 // metadata users are rare, so we lazily allocate it. If that changes we | 44 // metadata users are rare, so we lazily allocate it. If that changes we |
| 45 // can decide to just make it a field in the device (rather than a ptr) | 45 // can decide to just make it a field in the device (rather than a ptr) |
| 46 if (NULL == fMetaData) { | 46 if (NULL == fMetaData) { |
| 47 fMetaData = new SkMetaData; | 47 fMetaData = new SkMetaData; |
| 48 } | 48 } |
| 49 return *fMetaData; | 49 return *fMetaData; |
| 50 } | 50 } |
| 51 | 51 |
| 52 // TODO: should make this guy pure-virtual. | |
| 53 SkImageInfo SkBaseDevice::imageInfo() const { | 52 SkImageInfo SkBaseDevice::imageInfo() const { |
| 54 return SkImageInfo::MakeUnknown(this->width(), this->height()); | 53 return SkImageInfo::MakeUnknown(); |
| 55 } | 54 } |
| 56 | 55 |
| 57 const SkBitmap& SkBaseDevice::accessBitmap(bool changePixels) { | 56 const SkBitmap& SkBaseDevice::accessBitmap(bool changePixels) { |
| 58 const SkBitmap& bitmap = this->onAccessBitmap(); | 57 const SkBitmap& bitmap = this->onAccessBitmap(); |
| 59 if (changePixels) { | 58 if (changePixels) { |
| 60 bitmap.notifyPixelsChanged(); | 59 bitmap.notifyPixelsChanged(); |
| 61 } | 60 } |
| 62 return bitmap; | 61 return bitmap; |
| 63 } | 62 } |
| 64 | 63 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 } | 135 } |
| 137 | 136 |
| 138 void SkBaseDevice::EXPERIMENTAL_purge(const SkPicture* picture) { | 137 void SkBaseDevice::EXPERIMENTAL_purge(const SkPicture* picture) { |
| 139 // Derived-classes may have data to purge but not the base class | 138 // Derived-classes may have data to purge but not the base class |
| 140 } | 139 } |
| 141 | 140 |
| 142 bool SkBaseDevice::EXPERIMENTAL_drawPicture(SkCanvas* canvas, const SkPicture* p
icture) { | 141 bool SkBaseDevice::EXPERIMENTAL_drawPicture(SkCanvas* canvas, const SkPicture* p
icture) { |
| 143 // The base class doesn't perform any accelerated picture rendering | 142 // The base class doesn't perform any accelerated picture rendering |
| 144 return false; | 143 return false; |
| 145 } | 144 } |
| OLD | NEW |