| 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" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 } | 29 } |
| 30 | 30 |
| 31 SkBaseDevice* SkBaseDevice::createCompatibleDevice(const SkImageInfo& info) { | 31 SkBaseDevice* SkBaseDevice::createCompatibleDevice(const SkImageInfo& info) { |
| 32 return this->onCreateDevice(info, kGeneral_Usage); | 32 return this->onCreateDevice(info, kGeneral_Usage); |
| 33 } | 33 } |
| 34 | 34 |
| 35 SkBaseDevice* SkBaseDevice::createCompatibleDeviceForSaveLayer(const SkImageInfo
& info) { | 35 SkBaseDevice* SkBaseDevice::createCompatibleDeviceForSaveLayer(const SkImageInfo
& info) { |
| 36 return this->onCreateDevice(info, kSaveLayer_Usage); | 36 return this->onCreateDevice(info, kSaveLayer_Usage); |
| 37 } | 37 } |
| 38 | 38 |
| 39 SkBaseDevice* SkBaseDevice::createCompatibleDeviceForImageFilter(const SkImageIn
fo& info) { |
| 40 return this->onCreateDevice(info, kImageFilter_Usage); |
| 41 } |
| 42 |
| 39 SkMetaData& SkBaseDevice::getMetaData() { | 43 SkMetaData& SkBaseDevice::getMetaData() { |
| 40 // 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 |
| 41 // 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) |
| 42 if (NULL == fMetaData) { | 46 if (NULL == fMetaData) { |
| 43 fMetaData = new SkMetaData; | 47 fMetaData = new SkMetaData; |
| 44 } | 48 } |
| 45 return *fMetaData; | 49 return *fMetaData; |
| 46 } | 50 } |
| 47 | 51 |
| 48 SkImageInfo SkBaseDevice::imageInfo() const { | 52 SkImageInfo SkBaseDevice::imageInfo() const { |
| (...skipping 131 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 |