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

Side by Side Diff: src/core/SkBitmap.cpp

Issue 132273004: use bitmap's fRowBytes, as the pixelref's is not (yet) reliable (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 11 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
« no previous file with comments | « no previous file | no next file » | 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 /* 2 /*
3 * Copyright 2008 The Android Open Source Project 3 * Copyright 2008 The Android Open Source Project
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 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 } 334 }
335 335
336 void SkBitmap::updatePixelsFromRef() const { 336 void SkBitmap::updatePixelsFromRef() const {
337 if (NULL != fPixelRef) { 337 if (NULL != fPixelRef) {
338 if (fPixelLockCount > 0) { 338 if (fPixelLockCount > 0) {
339 SkASSERT(fPixelRef->isLocked()); 339 SkASSERT(fPixelRef->isLocked());
340 340
341 void* p = fPixelRef->pixels(); 341 void* p = fPixelRef->pixels();
342 if (NULL != p) { 342 if (NULL != p) {
343 p = (char*)p 343 p = (char*)p
344 + fPixelRef->rowBytes() * fPixelRefOrigin.fY 344 + fPixelRefOrigin.fY * fRowBytes
345 + fPixelRefOrigin.fX * fBytesPerPixel; 345 + fPixelRefOrigin.fX * fBytesPerPixel;
346 } 346 }
347 fPixels = p; 347 fPixels = p;
348 SkRefCnt_SafeAssign(fColorTable, fPixelRef->colorTable()); 348 SkRefCnt_SafeAssign(fColorTable, fPixelRef->colorTable());
349 } else { 349 } else {
350 SkASSERT(0 == fPixelLockCount); 350 SkASSERT(0 == fPixelLockCount);
351 fPixels = NULL; 351 fPixels = NULL;
352 if (fColorTable) { 352 if (fColorTable) {
353 fColorTable->unref(); 353 fColorTable->unref();
354 fColorTable = NULL; 354 fColorTable = NULL;
(...skipping 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after
1636 if (NULL != uri) { 1636 if (NULL != uri) {
1637 str->appendf(" uri:\"%s\"", uri); 1637 str->appendf(" uri:\"%s\"", uri);
1638 } else { 1638 } else {
1639 str->appendf(" pixelref:%p", pr); 1639 str->appendf(" pixelref:%p", pr);
1640 } 1640 }
1641 } 1641 }
1642 1642
1643 str->append(")"); 1643 str->append(")");
1644 } 1644 }
1645 #endif 1645 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698