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

Side by Side Diff: gm/colorspacexform.cpp

Issue 2390263002: Add SkColorSpaceXform to the public API (Closed)
Patch Set: Remove type on enum 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 | « bench/ColorCodecBench.cpp ('k') | include/core/SkColorSpaceXform.h » ('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 2013 Google Inc. 2 * Copyright 2013 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 "gm.h" 8 #include "gm.h"
9 #include "SkColor.h" 9 #include "SkColor.h"
10 #include "SkColorSpaceXform.h" 10 #include "SkColorSpaceXform.h"
(...skipping 23 matching lines...) Expand all
34 34
35 SkMatrix44 wideGamut(SkMatrix44::kUninitialized_Constructor); 35 SkMatrix44 wideGamut(SkMatrix44::kUninitialized_Constructor);
36 wideGamut.set3x3RowMajorf(kWideGamutRGB_toXYZD50); 36 wideGamut.set3x3RowMajorf(kWideGamutRGB_toXYZD50);
37 37
38 sk_sp<SkColorSpace> srcSpace = SkColorSpace::NewNamed(SkColorSpace::kSRG B_Named); 38 sk_sp<SkColorSpace> srcSpace = SkColorSpace::NewNamed(SkColorSpace::kSRG B_Named);
39 sk_sp<SkColorSpace> dstSpace = 39 sk_sp<SkColorSpace> dstSpace =
40 SkColorSpace::NewRGB(SkColorSpace::kLinear_RenderTargetGamma, wi deGamut); 40 SkColorSpace::NewRGB(SkColorSpace::kLinear_RenderTargetGamma, wi deGamut);
41 std::unique_ptr<SkColorSpaceXform> xform = SkColorSpaceXform::New(srcSpa ce.get(), 41 std::unique_ptr<SkColorSpaceXform> xform = SkColorSpaceXform::New(srcSpa ce.get(),
42 dstSpa ce.get()); 42 dstSpa ce.get());
43 43
44 xform->apply(fWideGamutColors, colors, kNumColors, 44 xform->apply(SkColorSpaceXform::kRGBA_F32_ColorFormat, fWideGamutColors,
45 SkColorSpaceXform::kRGBA_F32_ColorFormat, 45 SkColorSpaceXform::kBGRA_8888_ColorFormat, colors, kNumColo rs,
46 SkColorSpaceXform::kBGRA_8888_ColorFormat, kOpaque_SkAlphaT ype); 46 kOpaque_SkAlphaType);
47 } 47 }
48 48
49 SkString onShortName() override { 49 SkString onShortName() override {
50 return SkString("colorspacexform"); 50 return SkString("colorspacexform");
51 } 51 }
52 52
53 SkISize onISize() override { 53 SkISize onISize() override {
54 return SkISize::Make(500, 200); 54 return SkISize::Make(500, 200);
55 } 55 }
56 56
(...skipping 22 matching lines...) Expand all
79 private: 79 private:
80 static constexpr int kNumColors = 10; 80 static constexpr int kNumColors = 10;
81 81
82 SkColor4f fSRGBColors[kNumColors]; 82 SkColor4f fSRGBColors[kNumColors];
83 SkColor4f fWideGamutColors[kNumColors]; 83 SkColor4f fWideGamutColors[kNumColors];
84 84
85 typedef skiagm::GM INHERITED; 85 typedef skiagm::GM INHERITED;
86 }; 86 };
87 87
88 DEF_GM(return new ColorSpaceXformGM;) 88 DEF_GM(return new ColorSpaceXformGM;)
OLDNEW
« no previous file with comments | « bench/ColorCodecBench.cpp ('k') | include/core/SkColorSpaceXform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698