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

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

Issue 1388113002: Bye bye processor data manager (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove files Created 5 years, 2 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/SkBitmapProcShader.h ('k') | src/core/SkColorFilter.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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 /////////////////////////////////////////////////////////////////////////////// 353 ///////////////////////////////////////////////////////////////////////////////
354 354
355 #if SK_SUPPORT_GPU 355 #if SK_SUPPORT_GPU
356 356
357 #include "GrTextureAccess.h" 357 #include "GrTextureAccess.h"
358 #include "SkGr.h" 358 #include "SkGr.h"
359 #include "effects/GrSimpleTextureEffect.h" 359 #include "effects/GrSimpleTextureEffect.h"
360 360
361 const GrFragmentProcessor* SkBitmapProcShader::asFragmentProcessor(GrContext* co ntext, 361 const GrFragmentProcessor* SkBitmapProcShader::asFragmentProcessor(GrContext* co ntext,
362 const SkMatrix& viewM, const SkMatr ix* localMatrix, 362 const SkMatrix& viewM, const SkMatr ix* localMatrix,
363 SkFilterQuality filterQuality, 363 SkFilterQuality filterQuality) cons t {
364 GrProcessorDataManager* procDataMan ager) const {
365 SkMatrix matrix; 364 SkMatrix matrix;
366 matrix.setIDiv(fRawBitmap.width(), fRawBitmap.height()); 365 matrix.setIDiv(fRawBitmap.width(), fRawBitmap.height());
367 366
368 SkMatrix lmInverse; 367 SkMatrix lmInverse;
369 if (!this->getLocalMatrix().invert(&lmInverse)) { 368 if (!this->getLocalMatrix().invert(&lmInverse)) {
370 return nullptr; 369 return nullptr;
371 } 370 }
372 if (localMatrix) { 371 if (localMatrix) {
373 SkMatrix inv; 372 SkMatrix inv;
374 if (!localMatrix->invert(&inv)) { 373 if (!localMatrix->invert(&inv)) {
(...skipping 20 matching lines...) Expand all
395 SkAutoTUnref<GrTexture> texture(GrRefCachedBitmapTexture(context, fRawBitmap , &params)); 394 SkAutoTUnref<GrTexture> texture(GrRefCachedBitmapTexture(context, fRawBitmap , &params));
396 395
397 if (!texture) { 396 if (!texture) {
398 SkErrorInternals::SetError( kInternalError_SkError, 397 SkErrorInternals::SetError( kInternalError_SkError,
399 "Couldn't convert bitmap to texture."); 398 "Couldn't convert bitmap to texture.");
400 return nullptr; 399 return nullptr;
401 } 400 }
402 401
403 SkAutoTUnref<GrFragmentProcessor> inner; 402 SkAutoTUnref<GrFragmentProcessor> inner;
404 if (doBicubic) { 403 if (doBicubic) {
405 inner.reset(GrBicubicEffect::Create(procDataManager, texture, matrix, tm )); 404 inner.reset(GrBicubicEffect::Create(texture, matrix, tm));
406 } else { 405 } else {
407 inner.reset(GrSimpleTextureEffect::Create(procDataManager, texture, matr ix, params)); 406 inner.reset(GrSimpleTextureEffect::Create(texture, matrix, params));
408 } 407 }
409 408
410 if (kAlpha_8_SkColorType == fRawBitmap.colorType()) { 409 if (kAlpha_8_SkColorType == fRawBitmap.colorType()) {
411 return GrFragmentProcessor::MulOutputByInputUnpremulColor(inner); 410 return GrFragmentProcessor::MulOutputByInputUnpremulColor(inner);
412 } 411 }
413 return GrFragmentProcessor::MulOutputByInputAlpha(inner); 412 return GrFragmentProcessor::MulOutputByInputAlpha(inner);
414 } 413 }
415 414
416 #endif 415 #endif
OLDNEW
« no previous file with comments | « src/core/SkBitmapProcShader.h ('k') | src/core/SkColorFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698