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

Side by Side Diff: src/codec/SkSwizzler.cpp

Issue 1267543002: Make SkSwizzler::Fill() support 565 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Check if pixel memory is zero initialized 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
« src/codec/SkJpegCodec.cpp ('K') | « src/codec/SkJpegCodec.cpp ('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 * Copyright 2015 Google Inc. 2 * Copyright 2015 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 "SkCodecPriv.h" 8 #include "SkCodecPriv.h"
9 #include "SkColorPriv.h" 9 #include "SkColorPriv.h"
10 #include "SkSwizzler.h" 10 #include "SkSwizzler.h"
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 break; 463 break;
464 case kGray_8_SkColorType: 464 case kGray_8_SkColorType:
465 // If the destination is kGray, the caller passes in an 8-bit color. 465 // If the destination is kGray, the caller passes in an 8-bit color.
466 // We will not assert that the high bits of colorOrIndex must be zer oed. 466 // We will not assert that the high bits of colorOrIndex must be zer oed.
467 // This allows us to take advantage of the fact that the low 8 bits of an 467 // This allows us to take advantage of the fact that the low 8 bits of an
468 // SKPMColor may be a valid a grayscale color. For example, the low 8 468 // SKPMColor may be a valid a grayscale color. For example, the low 8
469 // bits of SK_ColorBLACK are identical to the grayscale representati on 469 // bits of SK_ColorBLACK are identical to the grayscale representati on
470 // for black. 470 // for black.
471 memset(dstStartRow, (uint8_t) colorOrIndex, bytesToFill); 471 memset(dstStartRow, (uint8_t) colorOrIndex, bytesToFill);
472 break; 472 break;
473 case kRGB_565_SkColorType:
474 // If the destination is k565, the caller passes in a 16-bit color.
475 // We will not assert that the high bits of colorOrIndex must be zer oed.
476 // This allows us to take advantage of the fact that the low 16 bits of an
477 // SKPMColor may be a valid a 565 color. For example, the low 16
478 // bits of SK_ColorBLACK are identical to the 565 representation
479 // for black.
480 memset(dstStartRow, (uint16_t) colorOrIndex, bytesToFill);
481 break;
473 default: 482 default:
474 SkCodecPrintf("Error: Unsupported dst color type for fill(). Doing nothing.\n"); 483 SkCodecPrintf("Error: Unsupported dst color type for fill(). Doing nothing.\n");
475 SkASSERT(false); 484 SkASSERT(false);
476 break; 485 break;
477 } 486 }
478 } 487 }
OLDNEW
« src/codec/SkJpegCodec.cpp ('K') | « src/codec/SkJpegCodec.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698