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

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

Issue 728673002: remove unused kLCD_MaskFormat (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove associated Gr enum Created 6 years, 1 month 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
« no previous file with comments | « src/core/SkGlyph.h ('k') | src/core/SkPaint.cpp » ('j') | 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 2007 The Android Open Source Project 2 * Copyright 2007 The Android Open Source Project
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 "SkMask.h" 8 #include "SkMask.h"
9 9
10 /** returns the product if it is positive and fits in 31 bits. Otherwise this 10 /** returns the product if it is positive and fits in 31 bits. Otherwise this
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 } 45 }
46 46
47 /////////////////////////////////////////////////////////////////////////////// 47 ///////////////////////////////////////////////////////////////////////////////
48 48
49 static const int gMaskFormatToShift[] = { 49 static const int gMaskFormatToShift[] = {
50 ~0, // BW -- not supported 50 ~0, // BW -- not supported
51 0, // A8 51 0, // A8
52 0, // 3D 52 0, // 3D
53 2, // ARGB32 53 2, // ARGB32
54 1, // LCD16 54 1, // LCD16
55 2 // LCD32
56 }; 55 };
57 56
58 static int maskFormatToShift(SkMask::Format format) { 57 static int maskFormatToShift(SkMask::Format format) {
59 SkASSERT((unsigned)format < SK_ARRAY_COUNT(gMaskFormatToShift)); 58 SkASSERT((unsigned)format < SK_ARRAY_COUNT(gMaskFormatToShift));
60 SkASSERT(SkMask::kBW_Format != format); 59 SkASSERT(SkMask::kBW_Format != format);
61 return gMaskFormatToShift[format]; 60 return gMaskFormatToShift[format];
62 } 61 }
63 62
64 void* SkMask::getAddr(int x, int y) const { 63 void* SkMask::getAddr(int x, int y) const {
65 SkASSERT(kBW_Format != fFormat); 64 SkASSERT(kBW_Format != fFormat);
66 SkASSERT(fBounds.contains(x, y)); 65 SkASSERT(fBounds.contains(x, y));
67 SkASSERT(fImage); 66 SkASSERT(fImage);
68 67
69 char* addr = (char*)fImage; 68 char* addr = (char*)fImage;
70 addr += (y - fBounds.fTop) * fRowBytes; 69 addr += (y - fBounds.fTop) * fRowBytes;
71 addr += (x - fBounds.fLeft) << maskFormatToShift(fFormat); 70 addr += (x - fBounds.fLeft) << maskFormatToShift(fFormat);
72 return addr; 71 return addr;
73 } 72 }
OLDNEW
« no previous file with comments | « src/core/SkGlyph.h ('k') | src/core/SkPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698