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

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

Issue 1227413002: Fix SkImage::asLegacyBitmap() rowBytes assert (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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 | tests/SurfaceTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "SkImage_Base.h" 8 #include "SkImage_Base.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 return fBitmap.isOpaque(); 263 return fBitmap.isOpaque();
264 } 264 }
265 265
266 bool SkImage_Raster::onAsLegacyBitmap(SkBitmap* bitmap, LegacyBitmapMode mode) c onst { 266 bool SkImage_Raster::onAsLegacyBitmap(SkBitmap* bitmap, LegacyBitmapMode mode) c onst {
267 if (kRO_LegacyBitmapMode == mode) { 267 if (kRO_LegacyBitmapMode == mode) {
268 // When we're a snapshot from a surface, our bitmap may not be marked im mutable 268 // When we're a snapshot from a surface, our bitmap may not be marked im mutable
269 // even though logically always we are, but in that case we can't physic ally share our 269 // even though logically always we are, but in that case we can't physic ally share our
270 // pixelref since the caller might call setImmutable() themselves 270 // pixelref since the caller might call setImmutable() themselves
271 // (thus changing our state). 271 // (thus changing our state).
272 if (fBitmap.isImmutable()) { 272 if (fBitmap.isImmutable()) {
273 bitmap->setInfo(fBitmap.info()); 273 bitmap->setInfo(fBitmap.info(), fBitmap.rowBytes());
274 bitmap->setPixelRef(fBitmap.pixelRef(), fBitmap.pixelRefOrigin()); 274 bitmap->setPixelRef(fBitmap.pixelRef(), fBitmap.pixelRefOrigin());
275 return true; 275 return true;
276 } 276 }
277 } 277 }
278 return this->INHERITED::onAsLegacyBitmap(bitmap, mode); 278 return this->INHERITED::onAsLegacyBitmap(bitmap, mode);
279 } 279 }
OLDNEW
« no previous file with comments | « no previous file | tests/SurfaceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698