OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #ifndef SkBitmapDevice_DEFINED | 9 #ifndef SkBitmapDevice_DEFINED |
10 #define SkBitmapDevice_DEFINED | 10 #define SkBitmapDevice_DEFINED |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 sk_sp<SkSpecialImage> makeSpecial(const SkImage*) override; | 128 sk_sp<SkSpecialImage> makeSpecial(const SkImage*) override; |
129 sk_sp<SkSpecialImage> snapSpecial() override; | 129 sk_sp<SkSpecialImage> snapSpecial() override; |
130 | 130 |
131 /////////////////////////////////////////////////////////////////////////// | 131 /////////////////////////////////////////////////////////////////////////// |
132 | 132 |
133 /** Update as needed the pixel value in the bitmap, so that the caller can | 133 /** Update as needed the pixel value in the bitmap, so that the caller can |
134 access the pixels directly. Note: only the pixels field should be | 134 access the pixels directly. Note: only the pixels field should be |
135 altered. The config/width/height/rowbytes must remain unchanged. | 135 altered. The config/width/height/rowbytes must remain unchanged. |
136 @return the device contents as a bitmap | 136 @return the device contents as a bitmap |
137 */ | 137 */ |
| 138 #ifdef SK_SUPPORT_LEGACY_ACCESSBITMAP |
138 const SkBitmap& onAccessBitmap() override; | 139 const SkBitmap& onAccessBitmap() override; |
| 140 #else |
| 141 const SkBitmap& onAccessBitmap(); |
| 142 #endif |
139 | 143 |
140 SkPixelRef* getPixelRef() const { return fBitmap.pixelRef(); } | 144 SkPixelRef* getPixelRef() const { return fBitmap.pixelRef(); } |
141 // just for subclasses, to assign a custom pixelref | 145 // just for subclasses, to assign a custom pixelref |
142 SkPixelRef* setPixelRef(SkPixelRef* pr) { | 146 SkPixelRef* setPixelRef(SkPixelRef* pr) { |
143 fBitmap.setPixelRef(pr); | 147 fBitmap.setPixelRef(pr); |
144 return pr; | 148 return pr; |
145 } | 149 } |
146 | 150 |
147 bool onReadPixels(const SkImageInfo&, void*, size_t, int x, int y) override; | 151 bool onReadPixels(const SkImageInfo&, void*, size_t, int x, int y) override; |
148 bool onWritePixels(const SkImageInfo&, const void*, size_t, int, int) overri
de; | 152 bool onWritePixels(const SkImageInfo&, const void*, size_t, int, int) overri
de; |
(...skipping 23 matching lines...) Expand all Loading... |
172 SkImageFilterCache* getImageFilterCache() override; | 176 SkImageFilterCache* getImageFilterCache() override; |
173 | 177 |
174 SkBitmap fBitmap; | 178 SkBitmap fBitmap; |
175 | 179 |
176 void setNewSize(const SkISize&); // Used by SkCanvas for resetForNextPictur
e(). | 180 void setNewSize(const SkISize&); // Used by SkCanvas for resetForNextPictur
e(). |
177 | 181 |
178 typedef SkBaseDevice INHERITED; | 182 typedef SkBaseDevice INHERITED; |
179 }; | 183 }; |
180 | 184 |
181 #endif // SkBitmapDevice_DEFINED | 185 #endif // SkBitmapDevice_DEFINED |
OLD | NEW |