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

Side by Side Diff: src/image/SkImageShader.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/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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 #include "GrTextureAccess.h" 79 #include "GrTextureAccess.h"
80 #include "SkGr.h" 80 #include "SkGr.h"
81 #include "effects/GrSimpleTextureEffect.h" 81 #include "effects/GrSimpleTextureEffect.h"
82 #include "effects/GrBicubicEffect.h" 82 #include "effects/GrBicubicEffect.h"
83 #include "effects/GrSimpleTextureEffect.h" 83 #include "effects/GrSimpleTextureEffect.h"
84 84
85 const GrFragmentProcessor* SkImageShader::asFragmentProcessor(GrContext* context , 85 const GrFragmentProcessor* SkImageShader::asFragmentProcessor(GrContext* context ,
86 const SkMatrix& vi ewM, 86 const SkMatrix& vi ewM,
87 const SkMatrix* lo calMatrix, 87 const SkMatrix* lo calMatrix,
88 SkFilterQuality fi lterQuality, 88 SkFilterQuality fi lterQuality) const {
89 GrProcessorDataMan ager* mgr) const {
90 SkMatrix matrix; 89 SkMatrix matrix;
91 matrix.setIDiv(fImage->width(), fImage->height()); 90 matrix.setIDiv(fImage->width(), fImage->height());
92 91
93 SkMatrix lmInverse; 92 SkMatrix lmInverse;
94 if (!this->getLocalMatrix().invert(&lmInverse)) { 93 if (!this->getLocalMatrix().invert(&lmInverse)) {
95 return nullptr; 94 return nullptr;
96 } 95 }
97 if (localMatrix) { 96 if (localMatrix) {
98 SkMatrix inv; 97 SkMatrix inv;
99 if (!localMatrix->invert(&inv)) { 98 if (!localMatrix->invert(&inv)) {
(...skipping 23 matching lines...) Expand all
123 usageType = kTiled_Filtered_SkImageUsageType; 122 usageType = kTiled_Filtered_SkImageUsageType;
124 } 123 }
125 124
126 SkAutoTUnref<GrTexture> texture(as_IB(fImage)->asTextureRef(context, usageTy pe)); 125 SkAutoTUnref<GrTexture> texture(as_IB(fImage)->asTextureRef(context, usageTy pe));
127 if (!texture) { 126 if (!texture) {
128 return nullptr; 127 return nullptr;
129 } 128 }
130 129
131 SkAutoTUnref<GrFragmentProcessor> inner; 130 SkAutoTUnref<GrFragmentProcessor> inner;
132 if (doBicubic) { 131 if (doBicubic) {
133 inner.reset(GrBicubicEffect::Create(mgr, texture, matrix, tm)); 132 inner.reset(GrBicubicEffect::Create(texture, matrix, tm));
134 } else { 133 } else {
135 inner.reset(GrSimpleTextureEffect::Create(mgr, texture, matrix, params)) ; 134 inner.reset(GrSimpleTextureEffect::Create(texture, matrix, params));
136 } 135 }
137 136
138 if (GrPixelConfigIsAlphaOnly(texture->config())) { 137 if (GrPixelConfigIsAlphaOnly(texture->config())) {
139 return SkRef(inner.get()); 138 return SkRef(inner.get());
140 } 139 }
141 return GrFragmentProcessor::MulOutputByInputAlpha(inner); 140 return GrFragmentProcessor::MulOutputByInputAlpha(inner);
142 } 141 }
143 142
144 #endif 143 #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