| 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/vector_platform_device_skia.h" | 5 #include "skia/ext/vector_platform_device_skia.h" |
| 6 | 6 |
| 7 #include "skia/ext/bitmap_platform_device.h" | 7 #include "skia/ext/bitmap_platform_device.h" |
| 8 #include "third_party/skia/include/core/SkClipStack.h" | 8 #include "third_party/skia/include/core/SkClipStack.h" |
| 9 #include "third_party/skia/include/core/SkDraw.h" | 9 #include "third_party/skia/include/core/SkDraw.h" |
| 10 #include "third_party/skia/include/core/SkRect.h" | 10 #include "third_party/skia/include/core/SkRect.h" |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 // to unwrap the embedded SkPDFDevice. | 186 // to unwrap the embedded SkPDFDevice. |
| 187 VectorPlatformDeviceSkia* vector_device = | 187 VectorPlatformDeviceSkia* vector_device = |
| 188 static_cast<VectorPlatformDeviceSkia*>(device); | 188 static_cast<VectorPlatformDeviceSkia*>(device); |
| 189 vector_device->pdf_device_->setOrigin(vector_device->getOrigin().fX, | 189 vector_device->pdf_device_->setOrigin(vector_device->getOrigin().fX, |
| 190 vector_device->getOrigin().fY); | 190 vector_device->getOrigin().fY); |
| 191 real_device = vector_device->pdf_device_.get(); | 191 real_device = vector_device->pdf_device_.get(); |
| 192 } | 192 } |
| 193 pdf_device_->drawDevice(draw, real_device, x, y, paint); | 193 pdf_device_->drawDevice(draw, real_device, x, y, paint); |
| 194 } | 194 } |
| 195 | 195 |
| 196 void VectorPlatformDeviceSkia::setDrawingArea(SkPDFDevice::DrawingArea area) { |
| 197 pdf_device_->setDrawingArea(area); |
| 198 } |
| 199 |
| 196 #if defined(OS_WIN) | 200 #if defined(OS_WIN) |
| 197 void VectorPlatformDeviceSkia::DrawToNativeContext(HDC dc, | 201 void VectorPlatformDeviceSkia::DrawToNativeContext(HDC dc, |
| 198 int x, | 202 int x, |
| 199 int y, | 203 int y, |
| 200 const RECT* src_rect) { | 204 const RECT* src_rect) { |
| 201 SkASSERT(false); | 205 SkASSERT(false); |
| 202 } | 206 } |
| 203 #elif defined(OS_MACOSX) | 207 #elif defined(OS_MACOSX) |
| 204 void VectorPlatformDeviceSkia::DrawToNativeContext(CGContext* context, int x, | 208 void VectorPlatformDeviceSkia::DrawToNativeContext(CGContext* context, int x, |
| 205 int y, const CGRect* src_rect) { | 209 int y, const CGRect* src_rect) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 216 SkDevice* VectorPlatformDeviceSkia::onCreateCompatibleDevice( | 220 SkDevice* VectorPlatformDeviceSkia::onCreateCompatibleDevice( |
| 217 SkBitmap::Config config, int width, int height, bool isOpaque, | 221 SkBitmap::Config config, int width, int height, bool isOpaque, |
| 218 Usage /*usage*/) { | 222 Usage /*usage*/) { |
| 219 SkAutoTUnref<SkDevice> dev(pdf_device_->createCompatibleDevice(config, width, | 223 SkAutoTUnref<SkDevice> dev(pdf_device_->createCompatibleDevice(config, width, |
| 220 height, | 224 height, |
| 221 isOpaque)); | 225 isOpaque)); |
| 222 return new VectorPlatformDeviceSkia(static_cast<SkPDFDevice*>(dev.get())); | 226 return new VectorPlatformDeviceSkia(static_cast<SkPDFDevice*>(dev.get())); |
| 223 } | 227 } |
| 224 | 228 |
| 225 } // namespace skia | 229 } // namespace skia |
| OLD | NEW |