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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 SkPixelRef* getPixelRef() const { return fBitmap.pixelRef(); } | 112 SkPixelRef* getPixelRef() const { return fBitmap.pixelRef(); } |
113 // just for subclasses, to assign a custom pixelref | 113 // just for subclasses, to assign a custom pixelref |
114 SkPixelRef* setPixelRef(SkPixelRef* pr) { | 114 SkPixelRef* setPixelRef(SkPixelRef* pr) { |
115 fBitmap.setPixelRef(pr); | 115 fBitmap.setPixelRef(pr); |
116 return pr; | 116 return pr; |
117 } | 117 } |
118 | 118 |
119 bool onReadPixels(const SkImageInfo&, void*, size_t, int x, int y) override; | 119 bool onReadPixels(const SkImageInfo&, void*, size_t, int x, int y) override; |
120 bool onWritePixels(const SkImageInfo&, const void*, size_t, int, int) overri
de; | 120 bool onWritePixels(const SkImageInfo&, const void*, size_t, int, int) overri
de; |
121 void* onAccessPixels(SkImageInfo* info, size_t* rowBytes) override; | 121 void* onAccessPixels(SkImageInfo* info, size_t* rowBytes) override; |
122 | 122 void onAttachToCanvas(SkCanvas*) override; |
123 /** Called when this device is installed into a Canvas. Balanced by a call | 123 void onDetachFromCanvas() override; |
124 to unlockPixels() when the device is removed from a Canvas. | |
125 */ | |
126 void lockPixels() override; | |
127 void unlockPixels() override; | |
128 | 124 |
129 private: | 125 private: |
130 friend class SkCanvas; | 126 friend class SkCanvas; |
131 friend struct DeviceCM; //for setMatrixClip | 127 friend struct DeviceCM; //for setMatrixClip |
132 friend class SkDraw; | 128 friend class SkDraw; |
133 friend class SkDrawIter; | 129 friend class SkDrawIter; |
134 friend class SkDeviceFilteredPaint; | 130 friend class SkDeviceFilteredPaint; |
135 friend class SkDeviceImageFilterProxy; | 131 friend class SkDeviceImageFilterProxy; |
136 | 132 |
137 friend class SkSurface_Raster; | 133 friend class SkSurface_Raster; |
(...skipping 11 matching lines...) Expand all Loading... |
149 SkImageFilter::Cache* getImageFilterCache() override; | 145 SkImageFilter::Cache* getImageFilterCache() override; |
150 | 146 |
151 SkBitmap fBitmap; | 147 SkBitmap fBitmap; |
152 | 148 |
153 void setNewSize(const SkISize&); // Used by SkCanvas for resetForNextPictur
e(). | 149 void setNewSize(const SkISize&); // Used by SkCanvas for resetForNextPictur
e(). |
154 | 150 |
155 typedef SkBaseDevice INHERITED; | 151 typedef SkBaseDevice INHERITED; |
156 }; | 152 }; |
157 | 153 |
158 #endif // SkBitmapDevice_DEFINED | 154 #endif // SkBitmapDevice_DEFINED |
OLD | NEW |