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

Side by Side Diff: src/gpu/GrTextureToYUVPlanes.cpp

Issue 2396953002: Revert[8] "replace SkXfermode obj with SkBlendMode enum in paints" (Closed)
Patch Set: add tmp virtual to unroll legacy arithmodes Created 4 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/gpu/GrTextureParamsAdjuster.cpp ('k') | src/gpu/GrYUVProvider.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 2016 Google Inc. 2 * Copyright 2016 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 "GrTextureToYUVPlanes.h" 8 #include "GrTextureToYUVPlanes.h"
9 #include "effects/GrSimpleTextureEffect.h" 9 #include "effects/GrSimpleTextureEffect.h"
10 #include "effects/GrYUVEffect.h" 10 #include "effects/GrYUVEffect.h"
(...skipping 23 matching lines...) Expand all
34 sk_sp<GrFragmentProcessor> fp( 34 sk_sp<GrFragmentProcessor> fp(
35 GrSimpleTextureEffect::Make(src, nullptr, SkMatrix::MakeScale(xScale , yScale), filter)); 35 GrSimpleTextureEffect::Make(src, nullptr, SkMatrix::MakeScale(xScale , yScale), filter));
36 if (!fp) { 36 if (!fp) {
37 return false; 37 return false;
38 } 38 }
39 fp = proc(std::move(fp), colorSpace); 39 fp = proc(std::move(fp), colorSpace);
40 if (!fp) { 40 if (!fp) {
41 return false; 41 return false;
42 } 42 }
43 GrPaint paint; 43 GrPaint paint;
44 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); 44 paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
45 paint.addColorFragmentProcessor(std::move(fp)); 45 paint.addColorFragmentProcessor(std::move(fp));
46 dst->drawRect(GrNoClip(), paint, SkMatrix::I(), SkRect::MakeIWH(dstW, dstH)) ; 46 dst->drawRect(GrNoClip(), paint, SkMatrix::I(), SkRect::MakeIWH(dstW, dstH)) ;
47 return true; 47 return true;
48 } 48 }
49 49
50 bool GrTextureToYUVPlanes(GrTexture* texture, const SkISize sizes[3], void* cons t planes[3], 50 bool GrTextureToYUVPlanes(GrTexture* texture, const SkISize sizes[3], void* cons t planes[3],
51 const size_t rowBytes[3], SkYUVColorSpace colorSpace) { 51 const size_t rowBytes[3], SkYUVColorSpace colorSpace) {
52 if (GrContext* context = texture->getContext()) { 52 if (GrContext* context = texture->getContext()) {
53 // Depending on the relative sizes of the y, u, and v planes we may do 1 to 3 draws/ 53 // Depending on the relative sizes of the y, u, and v planes we may do 1 to 3 draws/
54 // readbacks. 54 // readbacks.
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 if (!tex->readPixels(0, 0, sizes[2].fWidth, sizes[2].fHeight, 224 if (!tex->readPixels(0, 0, sizes[2].fWidth, sizes[2].fHeight,
225 kAlpha_8_GrPixelConfig, planes[2], rowBytes [2])) { 225 kAlpha_8_GrPixelConfig, planes[2], rowBytes [2])) {
226 return false; 226 return false;
227 } 227 }
228 return true; 228 return true;
229 } 229 }
230 } 230 }
231 } 231 }
232 return false; 232 return false;
233 } 233 }
OLDNEW
« no previous file with comments | « src/gpu/GrTextureParamsAdjuster.cpp ('k') | src/gpu/GrYUVProvider.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698