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

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

Issue 2474973002: Remove dead code in SkBitmapProcLegacyShader::ContextSize (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Also fix SkOpSegment::nextChase Created 4 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 | « no previous file | src/pathops/SkOpSegment.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 2011 Google Inc. 2 * Copyright 2011 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 "SkBitmapProcShader.h" 8 #include "SkBitmapProcShader.h"
9 #include "SkBitmapProcState.h" 9 #include "SkBitmapProcState.h"
10 #include "SkBitmapProvider.h" 10 #include "SkBitmapProvider.h"
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 bool needsSwizzle = srcInfo.bytesPerPixel() == 4 && srcInfo.colorType() != k N32_SkColorType; 198 bool needsSwizzle = srcInfo.bytesPerPixel() == 4 && srcInfo.colorType() != k N32_SkColorType;
199 return SkShader::ContextRec::kPM4f_DstType == rec.fPreferredDstType 199 return SkShader::ContextRec::kPM4f_DstType == rec.fPreferredDstType
200 || needsPremul || needsSwizzle; 200 || needsPremul || needsSwizzle;
201 } 201 }
202 202
203 size_t SkBitmapProcLegacyShader::ContextSize(const ContextRec& rec, const SkImag eInfo& srcInfo) { 203 size_t SkBitmapProcLegacyShader::ContextSize(const ContextRec& rec, const SkImag eInfo& srcInfo) {
204 size_t size0 = sizeof(BitmapProcShaderContext) + sizeof(SkBitmapProcState); 204 size_t size0 = sizeof(BitmapProcShaderContext) + sizeof(SkBitmapProcState);
205 size_t size1 = sizeof(LinearPipelineContext) + sizeof(SkBitmapProcInfo); 205 size_t size1 = sizeof(LinearPipelineContext) + sizeof(SkBitmapProcInfo);
206 size_t s = SkTMax(size0, size1); 206 size_t s = SkTMax(size0, size1);
207 return s; 207 return s;
208 return SkTMax(size0, size1);
209 } 208 }
210 209
211 SkShader::Context* SkBitmapProcLegacyShader::MakeContext(const SkShader& shader, 210 SkShader::Context* SkBitmapProcLegacyShader::MakeContext(const SkShader& shader,
212 TileMode tmx, TileMode tmy, 211 TileMode tmx, TileMode tmy,
213 const SkBitmapProvider& provi der, 212 const SkBitmapProvider& provi der,
214 const ContextRec& rec, void* storage) { 213 const ContextRec& rec, void* storage) {
215 SkMatrix totalInverse; 214 SkMatrix totalInverse;
216 // Do this first, so we know the matrix can be inverted. 215 // Do this first, so we know the matrix can be inverted.
217 if (!shader.computeTotalInverse(rec, &totalInverse)) { 216 if (!shader.computeTotalInverse(rec, &totalInverse)) {
218 return nullptr; 217 return nullptr;
(...skipping 16 matching lines...) Expand all
235 void* stateStorage = (char*)storage + sizeof(BitmapProcShaderContext); 234 void* stateStorage = (char*)storage + sizeof(BitmapProcShaderContext);
236 SkBitmapProcState* state = new (stateStorage) SkBitmapProcState(provider , tmx, tmy, 235 SkBitmapProcState* state = new (stateStorage) SkBitmapProcState(provider , tmx, tmy,
237 treatmen t); 236 treatmen t);
238 if (!state->setup(totalInverse, *rec.fPaint)) { 237 if (!state->setup(totalInverse, *rec.fPaint)) {
239 state->~SkBitmapProcState(); 238 state->~SkBitmapProcState();
240 return nullptr; 239 return nullptr;
241 } 240 }
242 return new (storage) BitmapProcShaderContext(shader, rec, state); 241 return new (storage) BitmapProcShaderContext(shader, rec, state);
243 } 242 }
244 } 243 }
OLDNEW
« no previous file with comments | « no previous file | src/pathops/SkOpSegment.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698