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

Side by Side Diff: src/image/SkImageShader.cpp

Issue 1225923010: Refugee from Dead Machine 4: MDB Monster Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Last update from dead machine Created 4 years, 7 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/image/SkImageShader.h ('k') | src/image/SkImage_Gpu.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 2015 Google Inc. 2 * Copyright 2015 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 "SkBitmapProvider.h" 9 #include "SkBitmapProvider.h"
10 #include "SkImage_Base.h" 10 #include "SkImage_Base.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 #include "GrTextureAccess.h" 79 #include "GrTextureAccess.h"
80 #include "SkGr.h" 80 #include "SkGr.h"
81 #include "SkGrPriv.h" 81 #include "SkGrPriv.h"
82 #include "effects/GrSimpleTextureEffect.h" 82 #include "effects/GrSimpleTextureEffect.h"
83 #include "effects/GrBicubicEffect.h" 83 #include "effects/GrBicubicEffect.h"
84 #include "effects/GrSimpleTextureEffect.h" 84 #include "effects/GrSimpleTextureEffect.h"
85 85
86 const GrFragmentProcessor* SkImageShader::asFragmentProcessor(GrContext* context , 86 const GrFragmentProcessor* SkImageShader::asFragmentProcessor(GrContext* context ,
87 const SkMatrix& vi ewM, 87 const SkMatrix& vi ewM,
88 const SkMatrix* lo calMatrix, 88 const SkMatrix* lo calMatrix,
89 SkFilterQuality fi lterQuality) const { 89 SkFilterQuality fi lterQuality,
90 GrRenderTarget* ds t) const {
90 SkMatrix matrix; 91 SkMatrix matrix;
91 matrix.setIDiv(fImage->width(), fImage->height()); 92 matrix.setIDiv(fImage->width(), fImage->height());
92 93
93 SkMatrix lmInverse; 94 SkMatrix lmInverse;
94 if (!this->getLocalMatrix().invert(&lmInverse)) { 95 if (!this->getLocalMatrix().invert(&lmInverse)) {
95 return nullptr; 96 return nullptr;
96 } 97 }
97 if (localMatrix) { 98 if (localMatrix) {
98 SkMatrix inv; 99 SkMatrix inv;
99 if (!localMatrix->invert(&inv)) { 100 if (!localMatrix->invert(&inv)) {
(...skipping 13 matching lines...) Expand all
113 GrTextureParams::FilterMode textureFilterMode = 114 GrTextureParams::FilterMode textureFilterMode =
114 GrSkFilterQualityToGrFilterMode(filterQuality, viewM, this->getLocalMatrix() , &doBicubic); 115 GrSkFilterQualityToGrFilterMode(filterQuality, viewM, this->getLocalMatrix() , &doBicubic);
115 GrTextureParams params(tm, textureFilterMode); 116 GrTextureParams params(tm, textureFilterMode);
116 SkAutoTUnref<GrTexture> texture(as_IB(fImage)->asTextureRef(context, params) ); 117 SkAutoTUnref<GrTexture> texture(as_IB(fImage)->asTextureRef(context, params) );
117 if (!texture) { 118 if (!texture) {
118 return nullptr; 119 return nullptr;
119 } 120 }
120 121
121 SkAutoTUnref<const GrFragmentProcessor> inner; 122 SkAutoTUnref<const GrFragmentProcessor> inner;
122 if (doBicubic) { 123 if (doBicubic) {
123 inner.reset(GrBicubicEffect::Create(texture, matrix, tm)); 124 inner.reset(GrBicubicEffect::Create(texture, matrix, tm, dst));
124 } else { 125 } else {
125 inner.reset(GrSimpleTextureEffect::Create(texture, matrix, params)); 126 inner.reset(GrSimpleTextureEffect::Create(texture, matrix, params, kLoca l_GrCoordSet, dst));
126 } 127 }
127 128
128 if (GrPixelConfigIsAlphaOnly(texture->config())) { 129 if (GrPixelConfigIsAlphaOnly(texture->config())) {
129 return SkRef(inner.get()); 130 return SkRef(inner.get());
130 } 131 }
131 return GrFragmentProcessor::MulOutputByInputAlpha(inner); 132 return GrFragmentProcessor::MulOutputByInputAlpha(inner);
132 } 133 }
133 134
134 #endif 135 #endif
OLDNEW
« no previous file with comments | « src/image/SkImageShader.h ('k') | src/image/SkImage_Gpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698