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

Side by Side Diff: src/pdf/SkPDFImage.cpp

Issue 15002002: lockPixels before calling getColorTable. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « include/core/SkBitmap.h ('k') | 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 2010 The Android Open Source Project 3 * Copyright 2010 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 "SkPDFImage.h" 10 #include "SkPDFImage.h"
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 } else { 314 } else {
315 insertInt("Width", srcRect.width()); 315 insertInt("Width", srcRect.width());
316 insertInt("Height", srcRect.height()); 316 insertInt("Height", srcRect.height());
317 } 317 }
318 318
319 // if (!image mask) { 319 // if (!image mask) {
320 if (doingAlpha || alphaOnly) { 320 if (doingAlpha || alphaOnly) {
321 insertName("ColorSpace", "DeviceGray"); 321 insertName("ColorSpace", "DeviceGray");
322 } else if (config == SkBitmap::kIndex8_Config || 322 } else if (config == SkBitmap::kIndex8_Config ||
323 config == SkBitmap::kRLE_Index8_Config) { 323 config == SkBitmap::kRLE_Index8_Config) {
324 SkAutoLockPixels alp(bitmap);
324 insert("ColorSpace", 325 insert("ColorSpace",
325 makeIndexedColorSpace(bitmap.getColorTable()))->unref(); 326 makeIndexedColorSpace(bitmap.getColorTable()))->unref();
326 } else { 327 } else {
327 insertName("ColorSpace", "DeviceRGB"); 328 insertName("ColorSpace", "DeviceRGB");
328 } 329 }
329 // } 330 // }
330 331
331 int bitsPerComp = 8; 332 int bitsPerComp = 8;
332 if (config == SkBitmap::kARGB_4444_Config) { 333 if (config == SkBitmap::kARGB_4444_Config) {
333 bitsPerComp = 4; 334 bitsPerComp = 4;
(...skipping 12 matching lines...) Expand all
346 decodeValue->reserve(6); 347 decodeValue->reserve(6);
347 decodeValue->append(zeroVal.get()); 348 decodeValue->append(zeroVal.get());
348 decodeValue->append(scale5Val.get()); 349 decodeValue->append(scale5Val.get());
349 decodeValue->append(zeroVal.get()); 350 decodeValue->append(zeroVal.get());
350 decodeValue->append(scale6Val.get()); 351 decodeValue->append(scale6Val.get());
351 decodeValue->append(zeroVal.get()); 352 decodeValue->append(zeroVal.get());
352 decodeValue->append(scale5Val.get()); 353 decodeValue->append(scale5Val.get());
353 insert("Decode", decodeValue.get()); 354 insert("Decode", decodeValue.get());
354 } 355 }
355 } 356 }
OLDNEW
« no previous file with comments | « include/core/SkBitmap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698