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

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

Issue 3590011: Update use of SkCanvas and SkDevice to match change in Skia (Closed)
Patch Set: Bump deps again to bring in fix for memory leak Created 10 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
« no previous file with comments | « skia/ext/bitmap_platform_device_mac.cc ('k') | skia/ext/bitmap_platform_device_win.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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_BITMAP_PLATFORM_DEVICE_WIN_H_ 5 #ifndef SKIA_BITMAP_PLATFORM_DEVICE_WIN_H_
6 #define SKIA_BITMAP_PLATFORM_DEVICE_WIN_H_ 6 #define SKIA_BITMAP_PLATFORM_DEVICE_WIN_H_
7 #pragma once 7 #pragma once
8 8
9 #include "skia/ext/platform_device_win.h" 9 #include "skia/ext/platform_device_win.h"
10 10
11 namespace skia { 11 namespace skia {
12 12
13 class SkBitmapPlatformDeviceFactory : public SkRasterDeviceFactory {
14 public:
15 virtual SkDevice* newDevice(SkBitmap::Config config, int width, int height,
16 bool isOpaque, bool isForLayer);
17 };
18
13 // A device is basically a wrapper around SkBitmap that provides a surface for 19 // A device is basically a wrapper around SkBitmap that provides a surface for
14 // SkCanvas to draw into. Our device provides a surface Windows can also write 20 // SkCanvas to draw into. Our device provides a surface Windows can also write
15 // to. BitmapPlatformDevice creates a bitmap using CreateDIBSection() in a 21 // to. BitmapPlatformDevice creates a bitmap using CreateDIBSection() in a
16 // format that Skia supports and can then use this to draw ClearType into, etc. 22 // format that Skia supports and can then use this to draw ClearType into, etc.
17 // This pixel data is provided to the bitmap that the device contains so that it 23 // This pixel data is provided to the bitmap that the device contains so that it
18 // can be shared. 24 // can be shared.
19 // 25 //
20 // The device owns the pixel data, when the device goes away, the pixel data 26 // The device owns the pixel data, when the device goes away, the pixel data
21 // also becomes invalid. THIS IS DIFFERENT THAN NORMAL SKIA which uses 27 // also becomes invalid. THIS IS DIFFERENT THAN NORMAL SKIA which uses
22 // reference counting for the pixel data. In normal Skia, you could assign 28 // reference counting for the pixel data. In normal Skia, you could assign
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // the resulting GDI clip rect will be random. 61 // the resulting GDI clip rect will be random.
56 // 62 //
57 // Copy constucting and "=" is designed for saving the device or passing it 63 // Copy constucting and "=" is designed for saving the device or passing it
58 // around to another routine willing to deal with the bitmap data directly. 64 // around to another routine willing to deal with the bitmap data directly.
59 BitmapPlatformDevice(const BitmapPlatformDevice& other); 65 BitmapPlatformDevice(const BitmapPlatformDevice& other);
60 virtual ~BitmapPlatformDevice(); 66 virtual ~BitmapPlatformDevice();
61 67
62 // See warning for copy constructor above. 68 // See warning for copy constructor above.
63 BitmapPlatformDevice& operator=(const BitmapPlatformDevice& other); 69 BitmapPlatformDevice& operator=(const BitmapPlatformDevice& other);
64 70
71 virtual SkDeviceFactory* getDeviceFactory() {
72 return SkNEW(SkBitmapPlatformDeviceFactory);
73 }
74
65 // Retrieves the bitmap DC, which is the memory DC for our bitmap data. The 75 // Retrieves the bitmap DC, which is the memory DC for our bitmap data. The
66 // bitmap DC is lazy created. 76 // bitmap DC is lazy created.
67 virtual HDC getBitmapDC(); 77 virtual HDC getBitmapDC();
68 78
69 // Loads the given transform and clipping region into the HDC. This is 79 // Loads the given transform and clipping region into the HDC. This is
70 // overridden from SkDevice. 80 // overridden from SkDevice.
71 virtual void setMatrixClip(const SkMatrix& transform, const SkRegion& region); 81 virtual void setMatrixClip(const SkMatrix& transform, const SkRegion& region);
72 82
73 virtual void drawToHDC(HDC dc, int x, int y, const RECT* src_rect); 83 virtual void drawToHDC(HDC dc, int x, int y, const RECT* src_rect);
74 virtual void makeOpaque(int x, int y, int width, int height); 84 virtual void makeOpaque(int x, int y, int width, int height);
(...skipping 21 matching lines...) Expand all
96 106
97 // Data associated with this device, guaranteed non-null. We hold a reference 107 // Data associated with this device, guaranteed non-null. We hold a reference
98 // to this object. 108 // to this object.
99 BitmapPlatformDeviceData* data_; 109 BitmapPlatformDeviceData* data_;
100 }; 110 };
101 111
102 } // namespace skia 112 } // namespace skia
103 113
104 #endif // SKIA_BITMAP_PLATFORM_DEVICE_WIN_H_ 114 #endif // SKIA_BITMAP_PLATFORM_DEVICE_WIN_H_
105 115
OLDNEW
« no previous file with comments | « skia/ext/bitmap_platform_device_mac.cc ('k') | skia/ext/bitmap_platform_device_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698