| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |