OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "skia/public/interfaces/bitmap_skbitmap_struct_traits.h" | 5 #include "skia/public/interfaces/bitmap_skbitmap_struct_traits.h" |
6 | 6 |
7 namespace mojo { | 7 namespace mojo { |
8 | 8 |
9 namespace { | 9 namespace { |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 } | 44 } |
45 NOTREACHED(); | 45 NOTREACHED(); |
46 return kUnknown_SkAlphaType; | 46 return kUnknown_SkAlphaType; |
47 } | 47 } |
48 | 48 |
49 sk_sp<SkColorSpace> MojoProfileTypeToSk(skia::mojom::ColorProfileType type) { | 49 sk_sp<SkColorSpace> MojoProfileTypeToSk(skia::mojom::ColorProfileType type) { |
50 switch (type) { | 50 switch (type) { |
51 case skia::mojom::ColorProfileType::LINEAR: | 51 case skia::mojom::ColorProfileType::LINEAR: |
52 return nullptr; | 52 return nullptr; |
53 case skia::mojom::ColorProfileType::SRGB: | 53 case skia::mojom::ColorProfileType::SRGB: |
54 return SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); | 54 return SkColorSpace::MakeNamed(SkColorSpace::kSRGB_Named); |
55 } | 55 } |
56 NOTREACHED(); | 56 NOTREACHED(); |
57 return nullptr; | 57 return nullptr; |
58 } | 58 } |
59 | 59 |
60 skia::mojom::ColorType SkColorTypeToMojo(SkColorType type) { | 60 skia::mojom::ColorType SkColorTypeToMojo(SkColorType type) { |
61 switch (type) { | 61 switch (type) { |
62 case kUnknown_SkColorType: | 62 case kUnknown_SkColorType: |
63 return skia::mojom::ColorType::UNKNOWN; | 63 return skia::mojom::ColorType::UNKNOWN; |
64 case kAlpha_8_SkColorType: | 64 case kAlpha_8_SkColorType: |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 } | 208 } |
209 | 209 |
210 // static | 210 // static |
211 void StructTraits<skia::mojom::BitmapDataView, SkBitmap>::TearDownContext( | 211 void StructTraits<skia::mojom::BitmapDataView, SkBitmap>::TearDownContext( |
212 const SkBitmap& b, | 212 const SkBitmap& b, |
213 void* context) { | 213 void* context) { |
214 b.unlockPixels(); | 214 b.unlockPixels(); |
215 } | 215 } |
216 | 216 |
217 } // namespace mojo | 217 } // namespace mojo |
OLD | NEW |