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

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

Issue 1703013002: misc fixes to make float buffers work a little better (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « src/core/SkBitmap.cpp ('k') | src/core/SkConfig8888.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 2006 The Android Open Source Project 2 * Copyright 2006 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 "SkBlitter.h" 8 #include "SkBlitter.h"
9 #include "SkAntiRun.h" 9 #include "SkAntiRun.h"
10 #include "SkColor.h" 10 #include "SkColor.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 } 120 }
121 121
122 // maskBitCount is the number of 1's to place in the mask. It must be in the ran ge between 1 and 8. 122 // maskBitCount is the number of 1's to place in the mask. It must be in the ran ge between 1 and 8.
123 static uint8_t generate_right_mask(int maskBitCount) { 123 static uint8_t generate_right_mask(int maskBitCount) {
124 return static_cast<uint8_t>(0xFF00U >> maskBitCount); 124 return static_cast<uint8_t>(0xFF00U >> maskBitCount);
125 } 125 }
126 126
127 void SkBlitter::blitMask(const SkMask& mask, const SkIRect& clip) { 127 void SkBlitter::blitMask(const SkMask& mask, const SkIRect& clip) {
128 SkASSERT(mask.fBounds.contains(clip)); 128 SkASSERT(mask.fBounds.contains(clip));
129 129
130 if (mask.fFormat == SkMask::kLCD16_Format) {
131 return; // needs to be handled by subclass
132 }
133
130 if (mask.fFormat == SkMask::kBW_Format) { 134 if (mask.fFormat == SkMask::kBW_Format) {
131 int cx = clip.fLeft; 135 int cx = clip.fLeft;
132 int cy = clip.fTop; 136 int cy = clip.fTop;
133 int maskLeft = mask.fBounds.fLeft; 137 int maskLeft = mask.fBounds.fLeft;
134 int maskRowBytes = mask.fRowBytes; 138 int maskRowBytes = mask.fRowBytes;
135 int height = clip.height(); 139 int height = clip.height();
136 140
137 const uint8_t* bits = mask.getAddr1(cx, cy); 141 const uint8_t* bits = mask.getAddr1(cx, cy);
138 142
139 SkDEBUGCODE(const uint8_t* endOfImage = 143 SkDEBUGCODE(const uint8_t* endOfImage =
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after
991 fShaderContext->~Context(); 995 fShaderContext->~Context();
992 SkShader::Context* ctx = fShader->createContext(rec, (void*)fShaderContext); 996 SkShader::Context* ctx = fShader->createContext(rec, (void*)fShaderContext);
993 if (nullptr == ctx) { 997 if (nullptr == ctx) {
994 // Need a valid context in fShaderContext's storage, so we can later (or our caller) call 998 // Need a valid context in fShaderContext's storage, so we can later (or our caller) call
995 // the in-place destructor. 999 // the in-place destructor.
996 new (fShaderContext) SkZeroShaderContext(*fShader, rec); 1000 new (fShaderContext) SkZeroShaderContext(*fShader, rec);
997 return false; 1001 return false;
998 } 1002 }
999 return true; 1003 return true;
1000 } 1004 }
OLDNEW
« no previous file with comments | « src/core/SkBitmap.cpp ('k') | src/core/SkConfig8888.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698