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

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

Issue 6820038: Push the initial transform down into SkPDFDevice. (Chrome side). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 8 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
« no previous file with comments | « printing/pdf_metafile_skia.cc ('k') | skia/ext/vector_platform_device_skia.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef SKIA_EXT_VECTOR_PLATFORM_DEVICE_SKIA_H_ 5 #ifndef SKIA_EXT_VECTOR_PLATFORM_DEVICE_SKIA_H_
6 #define SKIA_EXT_VECTOR_PLATFORM_DEVICE_SKIA_H_ 6 #define SKIA_EXT_VECTOR_PLATFORM_DEVICE_SKIA_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "skia/ext/platform_device.h" 11 #include "skia/ext/platform_device.h"
12 #include "third_party/skia/include/core/SkMatrix.h"
13 #include "third_party/skia/include/core/SkRefCnt.h" 12 #include "third_party/skia/include/core/SkRefCnt.h"
14 #include "third_party/skia/include/core/SkTScopedPtr.h" 13 #include "third_party/skia/include/core/SkTScopedPtr.h"
15 #include "third_party/skia/include/pdf/SkPDFDevice.h" 14 #include "third_party/skia/include/pdf/SkPDFDevice.h"
16 15
17 class SkClipStack; 16 class SkClipStack;
17 class SkMatrix;
18 struct SkIRect; 18 struct SkIRect;
19 struct SkRect; 19 struct SkRect;
20 20
21 namespace skia { 21 namespace skia {
22 22
23 class BitmapPlatformDevice; 23 class BitmapPlatformDevice;
24 24
25 class VectorPlatformDeviceSkiaFactory : public SkDeviceFactory { 25 class VectorPlatformDeviceSkiaFactory : public SkDeviceFactory {
26 public: 26 public:
27 virtual SkDevice* newDevice(SkCanvas* notUsed, SkBitmap::Config config, 27 virtual SkDevice* newDevice(SkCanvas* notUsed, SkBitmap::Config config,
28 int width, int height, bool isOpaque, 28 int width, int height, bool isOpaque,
29 bool isForLayer); 29 bool isForLayer);
30 }; 30 };
31 31
32 class VectorPlatformDeviceSkia : public PlatformDevice { 32 class VectorPlatformDeviceSkia : public PlatformDevice {
33 public: 33 public:
34 VectorPlatformDeviceSkia(int width, int height, 34 VectorPlatformDeviceSkia(int width, int height, SkMatrix* initialTransform);
alokp 2011/04/11 17:30:12 may be use const SkMatrix*, but if there is a fast
vandebo (ex-Chrome) 2011/04/11 21:51:31 Changed to const SkMatrix&
35 SkPDFDevice::OriginTransform flip);
36 35
37 ~VectorPlatformDeviceSkia(); 36 ~VectorPlatformDeviceSkia();
38 37
39 SkPDFDevice* PdfDevice() { return pdf_device_.get(); } 38 SkPDFDevice* PdfDevice() { return pdf_device_.get(); }
40 39
41 // PlatformDevice methods. 40 // PlatformDevice methods.
42 virtual bool IsVectorial(); 41 virtual bool IsVectorial();
43 virtual bool IsNativeFontRenderingAllowed(); 42 virtual bool IsNativeFontRenderingAllowed();
44 43
45 virtual PlatformSurface BeginPlatformPaint(); 44 virtual PlatformSurface BeginPlatformPaint();
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 const SkPoint texs[], const SkColor colors[], 80 const SkPoint texs[], const SkColor colors[],
82 SkXfermode* xmode, const uint16_t indices[], 81 SkXfermode* xmode, const uint16_t indices[],
83 int indexCount, const SkPaint& paint); 82 int indexCount, const SkPaint& paint);
84 virtual void drawDevice(const SkDraw& draw, SkDevice*, int x, int y, 83 virtual void drawDevice(const SkDraw& draw, SkDevice*, int x, int y,
85 const SkPaint&); 84 const SkPaint&);
86 85
87 #if defined(OS_WIN) 86 #if defined(OS_WIN)
88 virtual void drawToHDC(HDC dc, int x, int y, const RECT* src_rect); 87 virtual void drawToHDC(HDC dc, int x, int y, const RECT* src_rect);
89 #endif 88 #endif
90 89
91 // Our own methods.
92
93 // This needs to be called before anything is drawn.
94 void setInitialTransform(int xOffset, int yOffset, float scale_factor);
95
96 private: 90 private:
97 SkRefPtr<SkPDFDevice> pdf_device_; 91 SkRefPtr<SkPDFDevice> pdf_device_;
98 SkMatrix base_transform_;
99 SkRefPtr<BitmapPlatformDevice> raster_surface_; 92 SkRefPtr<BitmapPlatformDevice> raster_surface_;
100 93
101 DISALLOW_COPY_AND_ASSIGN(VectorPlatformDeviceSkia); 94 DISALLOW_COPY_AND_ASSIGN(VectorPlatformDeviceSkia);
102 }; 95 };
103 96
104 } // namespace skia 97 } // namespace skia
105 98
106 #endif // SKIA_EXT_VECTOR_PLATFORM_DEVICE_SKIA_H_ 99 #endif // SKIA_EXT_VECTOR_PLATFORM_DEVICE_SKIA_H_
OLDNEW
« no previous file with comments | « printing/pdf_metafile_skia.cc ('k') | skia/ext/vector_platform_device_skia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698