| 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 | |
| 200 #if defined(OS_WIN) | 196 #if defined(OS_WIN) |
| 201 void VectorPlatformDeviceSkia::DrawToNativeContext(HDC dc, | 197 void VectorPlatformDeviceSkia::DrawToNativeContext(HDC dc, |
| 202 int x, | 198 int x, |
| 203 int y, | 199 int y, |
| 204 const RECT* src_rect) { | 200 const RECT* src_rect) { |
| 205 SkASSERT(false); | 201 SkASSERT(false); |
| 206 } | 202 } |
| 207 #elif defined(OS_MACOSX) | 203 #elif defined(OS_MACOSX) |
| 208 void VectorPlatformDeviceSkia::DrawToNativeContext(CGContext* context, int x, | 204 void VectorPlatformDeviceSkia::DrawToNativeContext(CGContext* context, int x, |
| 209 int y, const CGRect* src_rect) { | 205 int y, const CGRect* src_rect) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 220 SkDevice* VectorPlatformDeviceSkia::onCreateCompatibleDevice( | 216 SkDevice* VectorPlatformDeviceSkia::onCreateCompatibleDevice( |
| 221 SkBitmap::Config config, int width, int height, bool isOpaque, | 217 SkBitmap::Config config, int width, int height, bool isOpaque, |
| 222 Usage /*usage*/) { | 218 Usage /*usage*/) { |
| 223 SkAutoTUnref<SkDevice> dev(pdf_device_->createCompatibleDevice(config, width, | 219 SkAutoTUnref<SkDevice> dev(pdf_device_->createCompatibleDevice(config, width, |
| 224 height, | 220 height, |
| 225 isOpaque)); | 221 isOpaque)); |
| 226 return new VectorPlatformDeviceSkia(static_cast<SkPDFDevice*>(dev.get())); | 222 return new VectorPlatformDeviceSkia(static_cast<SkPDFDevice*>(dev.get())); |
| 227 } | 223 } |
| 228 | 224 |
| 229 } // namespace skia | 225 } // namespace skia |
| OLD | NEW |