| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 // just for subclasses, to assign a custom pixelref | 145 // just for subclasses, to assign a custom pixelref |
| 146 SkPixelRef* setPixelRef(SkPixelRef* pr) { | 146 SkPixelRef* setPixelRef(SkPixelRef* pr) { |
| 147 fBitmap.setPixelRef(pr); | 147 fBitmap.setPixelRef(pr); |
| 148 return pr; | 148 return pr; |
| 149 } | 149 } |
| 150 | 150 |
| 151 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; |
| 152 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; |
| 153 bool onPeekPixels(SkPixmap*) override; | 153 bool onPeekPixels(SkPixmap*) override; |
| 154 bool onAccessPixels(SkPixmap*) override; | 154 bool onAccessPixels(SkPixmap*) override; |
| 155 void onAttachToCanvas(SkCanvas*) override; | |
| 156 void onDetachFromCanvas() override; | |
| 157 | 155 |
| 158 private: | 156 private: |
| 159 friend class SkCanvas; | 157 friend class SkCanvas; |
| 160 friend struct DeviceCM; //for setMatrixClip | 158 friend struct DeviceCM; //for setMatrixClip |
| 161 friend class SkDraw; | 159 friend class SkDraw; |
| 162 friend class SkDrawIter; | 160 friend class SkDrawIter; |
| 163 friend class SkDeviceFilteredPaint; | 161 friend class SkDeviceFilteredPaint; |
| 164 | 162 |
| 165 friend class SkSurface_Raster; | 163 friend class SkSurface_Raster; |
| 166 | 164 |
| 167 // used to change the backend's pixels (and possibly config/rowbytes) | 165 // used to change the backend's pixels (and possibly config/rowbytes) |
| 168 // but cannot change the width/height, so there should be no change to | 166 // but cannot change the width/height, so there should be no change to |
| 169 // any clip information. | 167 // any clip information. |
| 170 void replaceBitmapBackendForRasterSurface(const SkBitmap&) override; | 168 void replaceBitmapBackendForRasterSurface(const SkBitmap&) override; |
| 171 | 169 |
| 172 SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) override; | 170 SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) override; |
| 173 | 171 |
| 174 sk_sp<SkSurface> makeSurface(const SkImageInfo&, const SkSurfaceProps&) over
ride; | 172 sk_sp<SkSurface> makeSurface(const SkImageInfo&, const SkSurfaceProps&) over
ride; |
| 175 | 173 |
| 176 SkImageFilterCache* getImageFilterCache() override; | 174 SkImageFilterCache* getImageFilterCache() override; |
| 177 | 175 |
| 178 SkBitmap fBitmap; | 176 SkBitmap fBitmap; |
| 179 | 177 |
| 180 void setNewSize(const SkISize&); // Used by SkCanvas for resetForNextPictur
e(). | 178 void setNewSize(const SkISize&); // Used by SkCanvas for resetForNextPictur
e(). |
| 181 | 179 |
| 182 typedef SkBaseDevice INHERITED; | 180 typedef SkBaseDevice INHERITED; |
| 183 }; | 181 }; |
| 184 | 182 |
| 185 #endif // SkBitmapDevice_DEFINED | 183 #endif // SkBitmapDevice_DEFINED |
| OLD | NEW |