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

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

Issue 9416017: Optionally clear PlatformCanvas instances. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Address style issues. Created 8 years, 10 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 #ifndef SKIA_EXT_BITMAP_PLATFORM_DEVICE_LINUX_H_ 5 #ifndef SKIA_EXT_BITMAP_PLATFORM_DEVICE_LINUX_H_
6 #define SKIA_EXT_BITMAP_PLATFORM_DEVICE_LINUX_H_ 6 #define SKIA_EXT_BITMAP_PLATFORM_DEVICE_LINUX_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 public: 64 public:
65 // Create a BitmapPlatformDeviceLinux from an already constructed bitmap; 65 // Create a BitmapPlatformDeviceLinux from an already constructed bitmap;
66 // you should probably be using Create(). This may become private later if 66 // you should probably be using Create(). This may become private later if
67 // we ever have to share state between some native drawing UI and Skia, like 67 // we ever have to share state between some native drawing UI and Skia, like
68 // the Windows and Mac versions of this class do. 68 // the Windows and Mac versions of this class do.
69 // 69 //
70 // This object takes ownership of @data. 70 // This object takes ownership of @data.
71 BitmapPlatformDevice(const SkBitmap& other, BitmapPlatformDeviceData* data); 71 BitmapPlatformDevice(const SkBitmap& other, BitmapPlatformDeviceData* data);
72 virtual ~BitmapPlatformDevice(); 72 virtual ~BitmapPlatformDevice();
73 73
74 static BitmapPlatformDevice* Create(int width, int height, bool is_opaque); 74 static BitmapPlatformDevice* Create(int width, int height, int flags);
75 75
76 // This doesn't take ownership of |data| 76 // This doesn't take ownership of |data|
77 static BitmapPlatformDevice* Create(int width, int height, bool is_opaque, 77 static BitmapPlatformDevice* Create(int width, int height, int flags,
78 uint8_t* data); 78 uint8_t* data);
79 79
80 // Overridden from SkDevice: 80 // Overridden from SkDevice:
81 virtual void setMatrixClip(const SkMatrix& transform, const SkRegion& region, 81 virtual void setMatrixClip(const SkMatrix& transform, const SkRegion& region,
82 const SkClipStack&) OVERRIDE; 82 const SkClipStack&) OVERRIDE;
83 83
84 // Overridden from PlatformDevice: 84 // Overridden from PlatformDevice:
85 virtual cairo_t* BeginPlatformPaint() OVERRIDE; 85 virtual cairo_t* BeginPlatformPaint() OVERRIDE;
86 virtual void DrawToNativeContext(PlatformSurface surface, int x, int y, 86 virtual void DrawToNativeContext(PlatformSurface surface, int x, int y,
87 const PlatformRect* src_rect) OVERRIDE; 87 const PlatformRect* src_rect) OVERRIDE;
88 88
89 protected: 89 protected:
90 virtual SkDevice* onCreateCompatibleDevice(SkBitmap::Config, int width, 90 virtual SkDevice* onCreateCompatibleDevice(SkBitmap::Config, int width,
91 int height, bool isOpaque, 91 int height, bool isOpaque,
92 Usage usage) OVERRIDE; 92 Usage usage) OVERRIDE;
93 93
94 private: 94 private:
95 static BitmapPlatformDevice* Create(int width, int height, bool is_opaque, 95 static BitmapPlatformDevice* Create(int width, int height, int flags,
96 cairo_surface_t* surface); 96 cairo_surface_t* surface);
97 97
98 scoped_refptr<BitmapPlatformDeviceData> data_; 98 scoped_refptr<BitmapPlatformDeviceData> data_;
99 99
100 DISALLOW_COPY_AND_ASSIGN(BitmapPlatformDevice); 100 DISALLOW_COPY_AND_ASSIGN(BitmapPlatformDevice);
101 }; 101 };
102 102
103 } // namespace skia 103 } // namespace skia
104 104
105 #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_LINUX_H_ 105 #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_LINUX_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698