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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 bool onReadPixels(const SkImageInfo&, void*, size_t, int x, int y) SK_OVERRI
DE; | 126 bool onReadPixels(const SkImageInfo&, void*, size_t, int x, int y) SK_OVERRI
DE; |
127 bool onWritePixels(const SkImageInfo&, const void*, size_t, int, int) SK_OVE
RRIDE; | 127 bool onWritePixels(const SkImageInfo&, const void*, size_t, int, int) SK_OVE
RRIDE; |
128 void* onAccessPixels(SkImageInfo* info, size_t* rowBytes) SK_OVERRIDE; | 128 void* onAccessPixels(SkImageInfo* info, size_t* rowBytes) SK_OVERRIDE; |
129 | 129 |
130 /** Called when this device is installed into a Canvas. Balanced by a call | 130 /** Called when this device is installed into a Canvas. Balanced by a call |
131 to unlockPixels() when the device is removed from a Canvas. | 131 to unlockPixels() when the device is removed from a Canvas. |
132 */ | 132 */ |
133 void lockPixels() SK_OVERRIDE; | 133 void lockPixels() SK_OVERRIDE; |
134 void unlockPixels() SK_OVERRIDE; | 134 void unlockPixels() SK_OVERRIDE; |
135 | 135 |
| 136 |
| 137 /** Creates a backend bitmap for a new bitmap device. |
| 138 * returns true on success, with compatible bitmap in \target. |
| 139 */ |
| 140 static bool CreateBackendBitmap(const SkImageInfo& origInfo, SkBitmap* targe
t); |
136 private: | 141 private: |
137 friend class SkCanvas; | 142 friend class SkCanvas; |
138 friend struct DeviceCM; //for setMatrixClip | 143 friend struct DeviceCM; //for setMatrixClip |
139 friend class SkDraw; | 144 friend class SkDraw; |
140 friend class SkDrawIter; | 145 friend class SkDrawIter; |
141 friend class SkDeviceFilteredPaint; | 146 friend class SkDeviceFilteredPaint; |
142 friend class SkDeviceImageFilterProxy; | 147 friend class SkDeviceImageFilterProxy; |
143 | 148 |
144 friend class SkSurface_Raster; | 149 friend class SkSurface_Raster; |
| 150 friend class SkRasterDevice; |
145 | 151 |
146 // used to change the backend's pixels (and possibly config/rowbytes) | 152 // used to change the backend's pixels (and possibly config/rowbytes) |
147 // but cannot change the width/height, so there should be no change to | 153 // but cannot change the width/height, so there should be no change to |
148 // any clip information. | 154 // any clip information. |
149 void replaceBitmapBackendForRasterSurface(const SkBitmap&) SK_OVERRIDE; | 155 void replaceBitmapBackend(const SkBitmap&) SK_OVERRIDE; |
150 | 156 |
151 SkBaseDevice* onCreateCompatibleDevice(const CreateInfo&) SK_OVERRIDE; | 157 SkBaseDevice* onCreateCompatibleDevice(const CreateInfo&) SK_OVERRIDE; |
152 | 158 |
153 SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps&) SK_OVERRIDE
; | 159 SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps&) SK_OVERRIDE
; |
154 const void* peekPixels(SkImageInfo*, size_t* rowBytes) SK_OVERRIDE; | 160 const void* peekPixels(SkImageInfo*, size_t* rowBytes) SK_OVERRIDE; |
155 | 161 |
156 SkImageFilter::Cache* getImageFilterCache() SK_OVERRIDE; | 162 SkImageFilter::Cache* getImageFilterCache() SK_OVERRIDE; |
157 | 163 |
158 SkBitmap fBitmap; | 164 SkBitmap fBitmap; |
159 | 165 |
160 typedef SkBaseDevice INHERITED; | 166 typedef SkBaseDevice INHERITED; |
161 }; | 167 }; |
162 | 168 |
163 #endif // SkBitmapDevice_DEFINED | 169 #endif // SkBitmapDevice_DEFINED |
OLD | NEW |