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

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

Issue 2154753003: Introduce GrColorSpaceXform, for gamut conversion on textures (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
OLDNEW
(Empty)
1 /*
2 * Copyright 2016 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "GrColorSpaceXform.h"
9
10 sk_sp<GrColorSpaceXform> GrColorSpaceXform::Make(SkColorSpace* src,
11 SkColorSpace* dst ) {
12 if (!src || !dst) {
13 // Invalid
14 return nullptr;
15 }
16
17 if (src == dst) {
18 // Quick equality check - no conversion needed in this case
19 return nullptr;
20 }
21
22 SkMatrix44 srcToDst(SkMatrix44::kUninitialized_Constructor);
23 if (!dst->xyz().invert(&srcToDst)) {
24 return nullptr;
25 }
26 srcToDst.postConcat(src->xyz());
27
28 return sk_make_sp<GrColorSpaceXform>(srcToDst);
29 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698