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

Side by Side Diff: include/core/SkMask.h

Issue 14637007: Detect color masks, and divert to draw-sprite instead of maskblitters (Closed) Base URL: http://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 | « no previous file | src/core/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
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 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 #ifndef SkMask_DEFINED 10 #ifndef SkMask_DEFINED
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 * this asserts that the mask's format is kLCD32_Format, and that (x,y) 91 * this asserts that the mask's format is kLCD32_Format, and that (x,y)
92 * are contained in the mask's fBounds. 92 * are contained in the mask's fBounds.
93 */ 93 */
94 uint32_t* getAddrLCD32(int x, int y) const { 94 uint32_t* getAddrLCD32(int x, int y) const {
95 SkASSERT(kLCD32_Format == fFormat); 95 SkASSERT(kLCD32_Format == fFormat);
96 SkASSERT(fBounds.contains(x, y)); 96 SkASSERT(fBounds.contains(x, y));
97 SkASSERT(fImage != NULL); 97 SkASSERT(fImage != NULL);
98 uint32_t* row = (uint32_t*)(fImage + (y - fBounds.fTop) * fRowBytes); 98 uint32_t* row = (uint32_t*)(fImage + (y - fBounds.fTop) * fRowBytes);
99 return row + (x - fBounds.fLeft); 99 return row + (x - fBounds.fLeft);
100 } 100 }
101 101
102 /**
103 * Return the address of the specified 32bit mask. In the debug build,
104 * this asserts that the mask's format is 32bits, and that (x,y)
105 * are contained in the mask's fBounds.
106 */
107 uint32_t* getAddr32(int x, int y) const {
108 SkASSERT(kLCD32_Format == fFormat || kARGB32_Format == fFormat);
109 SkASSERT(fBounds.contains(x, y));
110 SkASSERT(fImage != NULL);
111 uint32_t* row = (uint32_t*)(fImage + (y - fBounds.fTop) * fRowBytes);
112 return row + (x - fBounds.fLeft);
113 }
114
102 /** 115 /**
103 * Returns the address of the specified pixel, computing the pixel-size 116 * Returns the address of the specified pixel, computing the pixel-size
104 * at runtime based on the mask format. This will be slightly slower than 117 * at runtime based on the mask format. This will be slightly slower than
105 * using one of the routines where the format is implied by the name 118 * using one of the routines where the format is implied by the name
106 * e.g. getAddr8 or getAddrLCD32. 119 * e.g. getAddr8 or getAddrLCD32.
107 * 120 *
108 * x,y must be contained by the mask's bounds (this is asserted in the 121 * x,y must be contained by the mask's bounds (this is asserted in the
109 * debug build, but not checked in the release build.) 122 * debug build, but not checked in the release build.)
110 * 123 *
111 * This should not be called with kBW_Format, as it will give unspecified 124 * This should not be called with kBW_Format, as it will give unspecified
(...skipping 27 matching lines...) Expand all
139 152
140 ~SkAutoMaskFreeImage() { 153 ~SkAutoMaskFreeImage() {
141 SkMask::FreeImage(fImage); 154 SkMask::FreeImage(fImage);
142 } 155 }
143 156
144 private: 157 private:
145 uint8_t* fImage; 158 uint8_t* fImage;
146 }; 159 };
147 160
148 #endif 161 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698