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

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

Issue 10915065: Add PlatformPictureSkia and RecordingPlatformDeviceSkia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add IsPlatformPaintSupported(), update comment in WebPluginDelegateProxy::Paint and require direct … Created 8 years, 2 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) 2012 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_RECORDING_PLATFORM_DEVICE_SKIA_H_
6 #define SKIA_EXT_VECTOR_PLATFORM_DEVICE_SKIA_H_ 6 #define SKIA_EXT_RECORDING_PLATFORM_DEVICE_SKIA_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/logging.h"
11 #include "skia/ext/platform_device.h" 10 #include "skia/ext/platform_device.h"
12 #include "third_party/skia/include/core/SkRefCnt.h"
13 #include "third_party/skia/include/core/SkTScopedPtr.h"
14 #include "third_party/skia/include/pdf/SkPDFDevice.h"
15 11
16 class SkMatrix; 12 class SkPicture;
17 13
18 namespace skia { 14 namespace skia {
19 15
20 class BitmapPlatformDevice; 16 class BitmapPlatformDevice;
21 17
22 class VectorPlatformDeviceSkia : public SkPDFDevice, public PlatformDevice { 18 class RecordingPlatformDeviceSkia : public SkDevice,
19 public PlatformDevice {
23 public: 20 public:
24 SK_API VectorPlatformDeviceSkia(const SkISize& pageSize, 21 RecordingPlatformDeviceSkia(
25 const SkISize& contentSize, 22 const SkBitmap& bitmap, SkPicture* picture);
26 const SkMatrix& initialTransform); 23 virtual ~RecordingPlatformDeviceSkia();
27 virtual ~VectorPlatformDeviceSkia();
28 24
29 // PlatformDevice methods. 25 static RecordingPlatformDeviceSkia* Create(
30 virtual bool SupportsPlatformPaint() OVERRIDE; 26 SkPicture* picture, int width, int height);
31 27
28 // Overridden from PlatformDevice:
29 virtual PlatformPaint PlatformPaintSupport() OVERRIDE;
32 virtual PlatformSurface BeginPlatformPaint() OVERRIDE; 30 virtual PlatformSurface BeginPlatformPaint() OVERRIDE;
33 virtual void EndPlatformPaint() OVERRIDE; 31 virtual void EndPlatformPaint() OVERRIDE;
34 #if defined(OS_WIN) 32 #if defined(OS_WIN)
35 virtual void DrawToNativeContext(HDC dc, 33 virtual void DrawToNativeContext(HDC dc,
36 int x, 34 int x,
37 int y, 35 int y,
38 const RECT* src_rect) OVERRIDE; 36 const RECT* src_rect) OVERRIDE;
39 #elif defined(OS_MACOSX) 37 #elif defined(OS_MACOSX)
40 virtual void DrawToNativeContext(CGContext* context, 38 virtual void DrawToNativeContext(CGContext* context,
41 int x, 39 int x,
42 int y, 40 int y,
43 const CGRect* src_rect) OVERRIDE; 41 const CGRect* src_rect) OVERRIDE;
44 virtual CGContextRef GetBitmapContext() OVERRIDE; 42 virtual CGContextRef GetBitmapContext() OVERRIDE;
45 #elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_OPENBSD) 43 #elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_OPENBSD)
46 virtual void DrawToNativeContext(PlatformSurface surface, 44 virtual void DrawToNativeContext(PlatformSurface surface,
47 int x, 45 int x,
48 int y, 46 int y,
49 const PlatformRect* src_rect) OVERRIDE; 47 const PlatformRect* src_rect) OVERRIDE;
50 #endif 48 #endif
51 49
52 private: 50 private:
53 SkRefPtr<BitmapPlatformDevice> raster_surface_; 51 SkCanvas* raster_canvas_;
52 SkPicture* picture_;
54 53
55 DISALLOW_COPY_AND_ASSIGN(VectorPlatformDeviceSkia); 54 DISALLOW_COPY_AND_ASSIGN(RecordingPlatformDeviceSkia);
56 }; 55 };
57 56
58 } // namespace skia 57 } // namespace skia
59 58
60 #endif // SKIA_EXT_VECTOR_PLATFORM_DEVICE_SKIA_H_ 59 #endif // SKIA_EXT_RECORDING_PLATFORM_DEVICE_SKIA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698