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

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

Issue 234833003: Revert of Rename kPMColor_SkColorType to kN32_SkColorType. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 8 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/SkBitmapDevice.cpp ('k') | src/core/SkBitmapProcShader.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 2013 Google Inc. 2 * Copyright 2013 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 "SkErrorInternals.h" 8 #include "SkErrorInternals.h"
9 #include "SkConvolver.h" 9 #include "SkConvolver.h"
10 #include "SkBitmapProcState.h" 10 #include "SkBitmapProcState.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 bool SkBitmapProcState::setBitmapFilterProcs() { 117 bool SkBitmapProcState::setBitmapFilterProcs() {
118 if (fFilterLevel != SkPaint::kHigh_FilterLevel) { 118 if (fFilterLevel != SkPaint::kHigh_FilterLevel) {
119 return false; 119 return false;
120 } 120 }
121 121
122 if (fAlphaScale != 256) { 122 if (fAlphaScale != 256) {
123 return false; 123 return false;
124 } 124 }
125 125
126 // TODO: consider supporting other colortypes (e.g. 565, A8) 126 // TODO: consider supporting other colortypes (e.g. 565, A8)
127 if (fBitmap->colorType() != kN32_SkColorType) { 127 if (fBitmap->colorType() != kPMColor_SkColorType) {
128 return false; 128 return false;
129 } 129 }
130 130
131 // TODO: consider supporting repeat and mirror 131 // TODO: consider supporting repeat and mirror
132 if (SkShader::kClamp_TileMode != fTileModeX || SkShader::kClamp_TileMode != fTileModeY) { 132 if (SkShader::kClamp_TileMode != fTileModeX || SkShader::kClamp_TileMode != fTileModeY) {
133 return false; 133 return false;
134 } 134 }
135 135
136 // TODO: is this right? do we want fBitmapFilter allocated even if we can't set shader procs? 136 // TODO: is this right? do we want fBitmapFilter allocated even if we can't set shader procs?
137 if (fInvType & (SkMatrix::kAffine_Mask | SkMatrix::kScale_Mask)) { 137 if (fInvType & (SkMatrix::kAffine_Mask | SkMatrix::kScale_Mask)) {
138 fBitmapFilter = SkBitmapFilter::Allocate(); 138 fBitmapFilter = SkBitmapFilter::Allocate();
139 } 139 }
140 140
141 if (fInvType & SkMatrix::kScale_Mask) { 141 if (fInvType & SkMatrix::kScale_Mask) {
142 fShaderProc32 = highQualityFilter32; 142 fShaderProc32 = highQualityFilter32;
143 fShaderProc16 = highQualityFilter16; 143 fShaderProc16 = highQualityFilter16;
144 return true; 144 return true;
145 } else { 145 } else {
146 return false; 146 return false;
147 } 147 }
148 } 148 }
OLDNEW
« no previous file with comments | « src/core/SkBitmapDevice.cpp ('k') | src/core/SkBitmapProcShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698