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

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

Issue 2154753003: Introduce GrColorSpaceXform, for gamut conversion on textures (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: More progress & refactoring Created 4 years, 5 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/GrBlurUtils.cpp ('k') | src/gpu/GrColorSpaceXform.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 2012 Google Inc. 2 * Copyright 2012 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 "GrClipMaskManager.h" 8 #include "GrClipMaskManager.h"
9 #include "GrCaps.h" 9 #include "GrCaps.h"
10 #include "GrDrawingManager.h" 10 #include "GrDrawingManager.h"
(...skipping 26 matching lines...) Expand all
37 SkMatrix mat; 37 SkMatrix mat;
38 // We use device coords to compute the texture coordinates. We set our matri x to be a 38 // We use device coords to compute the texture coordinates. We set our matri x to be a
39 // translation to the devBound, and then a scaling matrix to normalized coor ds. 39 // translation to the devBound, and then a scaling matrix to normalized coor ds.
40 mat.setIDiv(result->width(), result->height()); 40 mat.setIDiv(result->width(), result->height());
41 mat.preTranslate(SkIntToScalar(-devBound.fLeft), 41 mat.preTranslate(SkIntToScalar(-devBound.fLeft),
42 SkIntToScalar(-devBound.fTop)); 42 SkIntToScalar(-devBound.fTop));
43 43
44 SkIRect domainTexels = SkIRect::MakeWH(devBound.width(), devBound.height()); 44 SkIRect domainTexels = SkIRect::MakeWH(devBound.width(), devBound.height());
45 return sk_sp<GrFragmentProcessor>(GrTextureDomainEffect::Make( 45 return sk_sp<GrFragmentProcessor>(GrTextureDomainEffect::Make(
46 result, 46 result,
47 nullptr,
47 mat, 48 mat,
48 GrTextureDomain::MakeTexelDomain(result , domainTexels), 49 GrTextureDomain::MakeTexelDomain(result , domainTexels),
49 GrTextureDomain::kDecal_Mode, 50 GrTextureDomain::kDecal_Mode,
50 GrTextureParams::kNone_FilterMode, 51 GrTextureParams::kNone_FilterMode,
51 kDevice_GrCoordSet)); 52 kDevice_GrCoordSet));
52 } 53 }
53 54
54 // Does the path in 'element' require SW rendering? If so, return true (and, 55 // Does the path in 'element' require SW rendering? If so, return true (and,
55 // optionally, set 'prOut' to NULL. If not, return false (and, optionally, set 56 // optionally, set 'prOut' to NULL. If not, return false (and, optionally, set
56 // 'prOut' to the non-SW path renderer that will do the job). 57 // 'prOut' to the non-SW path renderer that will do the job).
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 sk_sp<GrTexture> result(texProvider->createApproxTexture(desc)); 810 sk_sp<GrTexture> result(texProvider->createApproxTexture(desc));
810 if (!result) { 811 if (!result) {
811 return nullptr; 812 return nullptr;
812 } 813 }
813 result->resourcePriv().setUniqueKey(key); 814 result->resourcePriv().setUniqueKey(key);
814 815
815 helper.toTexture(result.get()); 816 helper.toTexture(result.get());
816 817
817 return result; 818 return result;
818 } 819 }
OLDNEW
« no previous file with comments | « src/gpu/GrBlurUtils.cpp ('k') | src/gpu/GrColorSpaceXform.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698