From 55b23a0e5ac8b7e29ba56892d302286856b7f98a Mon Sep 17 00:00:00 2001 From: "aayushkumar@chromium.org" Date: Wed, 17 Aug 2011 23:09:36 +0000 Subject: Added Header and Footer support in Linux, Windows and Mac for Skia BUG=67514 TEST= In the preview tab, note added options for printing headers and footers. Toggle with the checkbox and ensure that the correct headers and footers are displayed. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=97219 Review URL: http://codereview.chromium.org/7348010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97233 0039d316-1c4b-4281-b951-d872f2087c98 --- skia/ext/vector_platform_device_skia.cc | 4 ++++ skia/ext/vector_platform_device_skia.h | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'skia') diff --git a/skia/ext/vector_platform_device_skia.cc b/skia/ext/vector_platform_device_skia.cc index bda7a60..0971d1a 100644 --- a/skia/ext/vector_platform_device_skia.cc +++ b/skia/ext/vector_platform_device_skia.cc @@ -193,6 +193,10 @@ void VectorPlatformDeviceSkia::drawDevice(const SkDraw& draw, pdf_device_->drawDevice(draw, real_device, x, y, paint); } +void VectorPlatformDeviceSkia::setDrawingArea(SkPDFDevice::DrawingArea area) { + pdf_device_->setDrawingArea(area); +} + #if defined(OS_WIN) void VectorPlatformDeviceSkia::DrawToNativeContext(HDC dc, int x, diff --git a/skia/ext/vector_platform_device_skia.h b/skia/ext/vector_platform_device_skia.h index 7aaa2a2..238996b 100644 --- a/skia/ext/vector_platform_device_skia.h +++ b/skia/ext/vector_platform_device_skia.h @@ -79,8 +79,12 @@ class VectorPlatformDeviceSkia : public PlatformDevice { virtual void drawDevice(const SkDraw& draw, SkDevice*, int x, int y, const SkPaint&); + // Sets the drawing area for the device. Subsequent draw calls are + // directed to the specific drawing area (margin or content area). + SK_API void setDrawingArea(SkPDFDevice::DrawingArea area); + protected: - virtual SkDevice* onCreateCompatibleDevice(SkBitmap::Config, int width, + virtual SkDevice* onCreateCompatibleDevice(SkBitmap::Config, int width, int height, bool isOpaque, Usage usage); -- cgit v1.1