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

Side by Side Diff: include/core/SkBitmapDevice.h

Issue 1155443004: change internals over to SkPixmap and stop using accessBitmap (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « no previous file | include/core/SkCanvas.h » ('j') | src/core/SkPixmap.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 111
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 bool onPeekPixels(SkPixmap*) override;
122 bool onAccessPixels(SkPixmap*) override;
122 void onAttachToCanvas(SkCanvas*) override; 123 void onAttachToCanvas(SkCanvas*) override;
123 void onDetachFromCanvas() override; 124 void onDetachFromCanvas() override;
124 125
125 private: 126 private:
126 friend class SkCanvas; 127 friend class SkCanvas;
127 friend struct DeviceCM; //for setMatrixClip 128 friend struct DeviceCM; //for setMatrixClip
128 friend class SkDraw; 129 friend class SkDraw;
129 friend class SkDrawIter; 130 friend class SkDrawIter;
130 friend class SkDeviceFilteredPaint; 131 friend class SkDeviceFilteredPaint;
131 friend class SkDeviceImageFilterProxy; 132 friend class SkDeviceImageFilterProxy;
132 133
133 friend class SkSurface_Raster; 134 friend class SkSurface_Raster;
134 135
135 // used to change the backend's pixels (and possibly config/rowbytes) 136 // used to change the backend's pixels (and possibly config/rowbytes)
136 // but cannot change the width/height, so there should be no change to 137 // but cannot change the width/height, so there should be no change to
137 // any clip information. 138 // any clip information.
138 void replaceBitmapBackendForRasterSurface(const SkBitmap&) override; 139 void replaceBitmapBackendForRasterSurface(const SkBitmap&) override;
139 140
140 SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) override; 141 SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) override;
141 142
142 SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps&) override; 143 SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps&) override;
143 const void* peekPixels(SkImageInfo*, size_t* rowBytes) override;
144 144
145 SkImageFilter::Cache* getImageFilterCache() override; 145 SkImageFilter::Cache* getImageFilterCache() override;
146 146
147 SkBitmap fBitmap; 147 SkBitmap fBitmap;
148 148
149 void setNewSize(const SkISize&); // Used by SkCanvas for resetForNextPictur e(). 149 void setNewSize(const SkISize&); // Used by SkCanvas for resetForNextPictur e().
150 150
151 typedef SkBaseDevice INHERITED; 151 typedef SkBaseDevice INHERITED;
152 }; 152 };
153 153
154 #endif // SkBitmapDevice_DEFINED 154 #endif // SkBitmapDevice_DEFINED
OLDNEW
« no previous file with comments | « no previous file | include/core/SkCanvas.h » ('j') | src/core/SkPixmap.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698