| OLD | NEW |
| 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 if (SkShader::kMirror_TileMode == tmx || SkShader::kMirror_TileMode == tmy)
{ | 219 if (SkShader::kMirror_TileMode == tmx || SkShader::kMirror_TileMode == tmy)
{ |
| 220 useLinearPipeline = false; | 220 useLinearPipeline = false; |
| 221 } | 221 } |
| 222 | 222 |
| 223 // New code doesn't support Mirror (YET), so we detect that here. | 223 // New code doesn't support Mirror (YET), so we detect that here. |
| 224 // | 224 // |
| 225 if (totalInverse.hasPerspective()) { | 225 if (totalInverse.hasPerspective()) { |
| 226 useLinearPipeline = false; | 226 useLinearPipeline = false; |
| 227 } | 227 } |
| 228 | 228 |
| 229 // |
| 230 // For now, only enable locally since we are hitting some crashers on the te
st bots |
| 231 // |
| 232 useLinearPipeline = false; |
| 233 |
| 229 if (useLinearPipeline) { | 234 if (useLinearPipeline) { |
| 230 void* infoStorage = (char*)storage + sizeof(LinearPipelineContext); | 235 void* infoStorage = (char*)storage + sizeof(LinearPipelineContext); |
| 231 SkBitmapProcInfo* info = new (infoStorage) SkBitmapProcInfo(provider, tm
x, tmy); | 236 SkBitmapProcInfo* info = new (infoStorage) SkBitmapProcInfo(provider, tm
x, tmy); |
| 232 if (!info->init(totalInverse, *rec.fPaint)) { | 237 if (!info->init(totalInverse, *rec.fPaint)) { |
| 233 info->~SkBitmapProcInfo(); | 238 info->~SkBitmapProcInfo(); |
| 234 return nullptr; | 239 return nullptr; |
| 235 } | 240 } |
| 236 return new (storage) LinearPipelineContext(shader, rec, info); | 241 return new (storage) LinearPipelineContext(shader, rec, info); |
| 237 } else { | 242 } else { |
| 238 void* stateStorage = (char*)storage + sizeof(BitmapProcShaderContext); | 243 void* stateStorage = (char*)storage + sizeof(BitmapProcShaderContext); |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 inner.reset(GrSimpleTextureEffect::Create(texture, matrix, params)); | 458 inner.reset(GrSimpleTextureEffect::Create(texture, matrix, params)); |
| 454 } | 459 } |
| 455 | 460 |
| 456 if (kAlpha_8_SkColorType == fRawBitmap.colorType()) { | 461 if (kAlpha_8_SkColorType == fRawBitmap.colorType()) { |
| 457 return GrFragmentProcessor::MulOutputByInputUnpremulColor(inner); | 462 return GrFragmentProcessor::MulOutputByInputUnpremulColor(inner); |
| 458 } | 463 } |
| 459 return GrFragmentProcessor::MulOutputByInputAlpha(inner); | 464 return GrFragmentProcessor::MulOutputByInputAlpha(inner); |
| 460 } | 465 } |
| 461 | 466 |
| 462 #endif | 467 #endif |
| OLD | NEW |