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

Side by Side Diff: skia/sgl/SkDither.cpp

Issue 113827: Remove the remainder of the skia source code from the Chromium repo.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 6 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 | « skia/sgl/SkDevice.cpp ('k') | skia/sgl/SkDraw.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #include "SkDither.h"
2
3 /* The base dither matrix we use to derive optimized ones for 565 and 4444
4
5 { 0, 32, 8, 40, 2, 34, 10, 42 },
6 { 48, 16, 56, 24, 50, 18, 58, 26 },
7 { 12, 44, 4, 36, 14, 46, 6, 38 },
8 { 60, 28, 52, 20, 62, 30, 54, 22 },
9 { 3, 35, 11, 43, 1, 33, 9, 41 },
10 { 51, 19, 59, 27, 49, 17, 57, 25 },
11 { 15, 47, 7, 39, 13, 45, 5, 37 },
12 { 63, 31, 55, 23, 61, 29, 53, 21 }
13
14 The 4444 version only needs 4 bits, and given that we can reduce its size
15 since the other 4x4 sub pieces all look the same once we truncate the bits.
16
17 The 565 version only needs 3 bits for red/blue, and only 2 bits for green.
18 For simplicity, we store 3 bits, and have the dither macros for green know
19 this, and they shift the dither value down by 1 to make it 2 bits.
20 */
21
22 #ifdef ENABLE_DITHER_MATRIX_4X4
23
24 const uint8_t gDitherMatrix_4Bit_4X4[4][4] = {
25 { 0, 8, 2, 10 },
26 { 12, 4, 14, 6 },
27 { 3, 11, 1, 9 },
28 { 15, 7, 13, 5 }
29 };
30
31 const uint8_t gDitherMatrix_3Bit_4X4[4][4] = {
32 { 0, 4, 1, 5 },
33 { 6, 2, 7, 3 },
34 { 1, 5, 0, 4 },
35 { 7, 3, 6, 2 }
36 };
37
38 #else // used packed shorts for a scanlines worth of dither values
39
40 const uint16_t gDitherMatrix_4Bit_16[4] = {
41 0xA280, 0x6E4C, 0x91B3, 0x5D7F
42 };
43
44 const uint16_t gDitherMatrix_3Bit_16[4] = {
45 0x5140, 0x3726, 0x4051, 0x2637
46 };
47
48 #endif
49
OLDNEW
« no previous file with comments | « skia/sgl/SkDevice.cpp ('k') | skia/sgl/SkDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698