| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "skia/ext/platform_device.h" | 5 #include "skia/ext/platform_device.h" |
| 6 | 6 |
| 7 #include "third_party/skia/include/core/SkMetaData.h" | 7 #include "third_party/skia/include/core/SkMetaData.h" |
| 8 | 8 |
| 9 namespace skia { | 9 namespace skia { |
| 10 | 10 |
| 11 namespace { | 11 namespace { |
| 12 const char* kDevicePlatformBehaviour = "CrDevicePlatformBehaviour"; | 12 const char* kDevicePlatformBehaviour = "CrDevicePlatformBehaviour"; |
| 13 } | 13 } |
| 14 | 14 |
| 15 void SetPlatformDevice(SkDevice* device, PlatformDevice* platform_behaviour) { | 15 void SetPlatformDevice(SkDevice* device, PlatformDevice* platform_behaviour) { |
| 16 SkMetaData& meta_data = device->getMetaData(); | 16 SkMetaData& meta_data = device->getMetaData(); |
| 17 meta_data.setPtr(kDevicePlatformBehaviour, platform_behaviour); | 17 meta_data.setPtr(kDevicePlatformBehaviour, platform_behaviour); |
| 18 } | 18 } |
| 19 | 19 |
| 20 PlatformDevice* GetPlatformDevice(SkDevice* device) { | 20 PlatformDevice* GetPlatformDevice(SkDevice* device) { |
| 21 SkMetaData& meta_data = device->getMetaData(); | 21 SkMetaData& meta_data = device->getMetaData(); |
| 22 PlatformDevice* device_behaviour = NULL; | 22 PlatformDevice* device_behaviour = NULL; |
| 23 if (meta_data.findPtr(kDevicePlatformBehaviour, | 23 if (meta_data.findPtr(kDevicePlatformBehaviour, |
| 24 reinterpret_cast<void**>(&device_behaviour))) | 24 reinterpret_cast<void**>(&device_behaviour))) |
| 25 return device_behaviour; | 25 return device_behaviour; |
| 26 | 26 |
| 27 return NULL; | 27 return NULL; |
| 28 } | 28 } |
| 29 | 29 |
| 30 bool PlatformDevice::IsNativeFontRenderingAllowed() { |
| 31 return true; |
| 32 } |
| 33 |
| 34 bool PlatformDevice::AlphaBlendUsed() const { |
| 35 return false; |
| 36 } |
| 37 |
| 30 } // namespace skia | 38 } // namespace skia |
| 31 | |
| OLD | NEW |