Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: skia/ext/vector_platform_device_skia.cc

Issue 7348010: Added Header and Footer support using Skia (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Custom length strings being printed Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 if ((device->getDeviceCapabilities() & kVector_Capability)) { 184 if ((device->getDeviceCapabilities() & kVector_Capability)) {
185 // Assume that a vectorial device means a VectorPlatformDeviceSkia, we need 185 // Assume that a vectorial device means a VectorPlatformDeviceSkia, we need
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 real_device = vector_device->pdf_device_.get(); 189 real_device = vector_device->pdf_device_.get();
190 } 190 }
191 pdf_device_->drawDevice(draw, real_device, x, y, paint); 191 pdf_device_->drawDevice(draw, real_device, x, y, paint);
192 } 192 }
193 193
194 void VectorPlatformDeviceSkia::setDrawingArea(SkPDFDevice::DrawingArea area) {
195 pdf_device_->setDrawingArea(area);
196 }
197
194 #if defined(OS_WIN) 198 #if defined(OS_WIN)
195 void VectorPlatformDeviceSkia::DrawToNativeContext(HDC dc, 199 void VectorPlatformDeviceSkia::DrawToNativeContext(HDC dc,
196 int x, 200 int x,
197 int y, 201 int y,
198 const RECT* src_rect) { 202 const RECT* src_rect) {
199 SkASSERT(false); 203 SkASSERT(false);
200 } 204 }
201 #elif defined(OS_MACOSX) 205 #elif defined(OS_MACOSX)
202 void VectorPlatformDeviceSkia::DrawToNativeContext(CGContext* context, int x, 206 void VectorPlatformDeviceSkia::DrawToNativeContext(CGContext* context, int x,
203 int y, const CGRect* src_rect) { 207 int y, const CGRect* src_rect) {
(...skipping 10 matching lines...) Expand all
214 SkDevice* VectorPlatformDeviceSkia::onCreateCompatibleDevice( 218 SkDevice* VectorPlatformDeviceSkia::onCreateCompatibleDevice(
215 SkBitmap::Config config, int width, int height, bool isOpaque, 219 SkBitmap::Config config, int width, int height, bool isOpaque,
216 Usage /*usage*/) { 220 Usage /*usage*/) {
217 SkAutoTUnref<SkDevice> dev(pdf_device_->createCompatibleDevice(config, width, 221 SkAutoTUnref<SkDevice> dev(pdf_device_->createCompatibleDevice(config, width,
218 height, 222 height,
219 isOpaque)); 223 isOpaque));
220 return new VectorPlatformDeviceSkia(static_cast<SkPDFDevice*>(dev.get())); 224 return new VectorPlatformDeviceSkia(static_cast<SkPDFDevice*>(dev.get()));
221 } 225 }
222 226
223 } // namespace skia 227 } // namespace skia
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698