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

Side by Side Diff: src/image/SkImage.cpp

Issue 1254383006: SkImage_Raster's pixels are always immutable. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 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
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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 } 247 }
248 unrefCopy.reset(tex); 248 unrefCopy.reset(tex);
249 } 249 }
250 const SkImageInfo info = bm.info(); 250 const SkImageInfo info = bm.info();
251 return SkNEW_ARGS(SkImage_Gpu, (info.width(), info.height(), info.alphaT ype(), 251 return SkNEW_ARGS(SkImage_Gpu, (info.width(), info.height(), info.alphaT ype(),
252 tex, 0, SkSurface::kNo_Budgeted)); 252 tex, 0, SkSurface::kNo_Budgeted));
253 } 253 }
254 #endif 254 #endif
255 255
256 // This will check for immutable (share or copy) 256 // This will check for immutable (share or copy)
257 return SkNewImageFromRasterBitmap(bm, false, nullptr, kUnlocked_SharedPixelR efMode); 257 return SkNewImageFromRasterBitmap(bm, nullptr, kUnlocked_SharedPixelRefMode) ;
258 } 258 }
259 259
260 bool SkImage::asLegacyBitmap(SkBitmap* bitmap, LegacyBitmapMode mode) const { 260 bool SkImage::asLegacyBitmap(SkBitmap* bitmap, LegacyBitmapMode mode) const {
261 return as_IB(this)->onAsLegacyBitmap(bitmap, mode); 261 return as_IB(this)->onAsLegacyBitmap(bitmap, mode);
262 } 262 }
263 263
264 bool SkImage_Base::onAsLegacyBitmap(SkBitmap* bitmap, LegacyBitmapMode mode) con st { 264 bool SkImage_Base::onAsLegacyBitmap(SkBitmap* bitmap, LegacyBitmapMode mode) con st {
265 // As the base-class, all we can do is make a copy (regardless of mode). 265 // As the base-class, all we can do is make a copy (regardless of mode).
266 // Subclasses that want to be more optimal should override. 266 // Subclasses that want to be more optimal should override.
267 SkImageInfo info = SkImageInfo::MakeN32(this->width(), this->height(), 267 SkImageInfo info = SkImageInfo::MakeN32(this->width(), this->height(),
(...skipping 23 matching lines...) Expand all
291 291
292 SkImage* SkImage::NewFromAdoptedTexture(GrContext*, const GrBackendTextureDesc&, SkAlphaType) { 292 SkImage* SkImage::NewFromAdoptedTexture(GrContext*, const GrBackendTextureDesc&, SkAlphaType) {
293 return NULL; 293 return NULL;
294 } 294 }
295 295
296 SkImage* SkImage::NewFromTextureCopy(GrContext*, const GrBackendTextureDesc&, Sk AlphaType) { 296 SkImage* SkImage::NewFromTextureCopy(GrContext*, const GrBackendTextureDesc&, Sk AlphaType) {
297 return NULL; 297 return NULL;
298 } 298 }
299 299
300 #endif 300 #endif
OLDNEW
« src/core/SkPixelRef.cpp ('K') | « src/core/SkPixelRef.cpp ('k') | src/image/SkImagePriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698