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

Side by Side Diff: src/utils/SkPictureUtils.cpp

Issue 199413013: add new readPixels with direct memory parameters (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkBitmapDevice.h" 8 #include "SkBitmapDevice.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 const uint16_t indices[], int indexCount, 157 const uint16_t indices[], int indexCount,
158 const SkPaint& paint) SK_OVERRIDE { 158 const SkPaint& paint) SK_OVERRIDE {
159 this->addBitmapFromPaint(paint); 159 this->addBitmapFromPaint(paint);
160 } 160 }
161 virtual void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, 161 virtual void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y,
162 const SkPaint&) SK_OVERRIDE { 162 const SkPaint&) SK_OVERRIDE {
163 nothing_to_do(); 163 nothing_to_do();
164 } 164 }
165 165
166 protected: 166 protected:
167 virtual bool onReadPixels(const SkBitmap& bitmap,
168 int x, int y,
169 SkCanvas::Config8888 config8888) SK_OVERRIDE {
170 not_supported();
171 return false;
172 }
173
174 virtual void replaceBitmapBackendForRasterSurface(const SkBitmap&) SK_OVERRI DE { 167 virtual void replaceBitmapBackendForRasterSurface(const SkBitmap&) SK_OVERRI DE {
175 not_supported(); 168 not_supported();
176 } 169 }
177 virtual SkBaseDevice* onCreateDevice(const SkImageInfo& info, Usage usage) S K_OVERRIDE { 170 virtual SkBaseDevice* onCreateDevice(const SkImageInfo& info, Usage usage) S K_OVERRIDE {
178 // we expect to only get called via savelayer, in which case it is fine. 171 // we expect to only get called via savelayer, in which case it is fine.
179 SkASSERT(kSaveLayer_Usage == usage); 172 SkASSERT(kSaveLayer_Usage == usage);
180 return SkNEW_ARGS(GatherPixelRefDevice, (info.width(), info.height(), fP RSet)); 173 return SkNEW_ARGS(GatherPixelRefDevice, (info.width(), info.height(), fP RSet));
181 } 174 }
182 virtual void flush() SK_OVERRIDE {} 175 virtual void flush() SK_OVERRIDE {}
183 176
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 canvas.clipRect(area, SkRegion::kIntersect_Op, false); 221 canvas.clipRect(area, SkRegion::kIntersect_Op, false);
229 canvas.drawPicture(*pict); 222 canvas.drawPicture(*pict);
230 223
231 SkData* data = NULL; 224 SkData* data = NULL;
232 int count = array.count(); 225 int count = array.count();
233 if (count > 0) { 226 if (count > 0) {
234 data = SkData::NewFromMalloc(array.detach(), count * sizeof(SkPixelRef*) ); 227 data = SkData::NewFromMalloc(array.detach(), count * sizeof(SkPixelRef*) );
235 } 228 }
236 return data; 229 return data;
237 } 230 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698