OLD | NEW |
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 "SkRGBAToYUV.h" | 8 #include "SkRGBAToYUV.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkColorMatrixFilterRowMajor255.h" | 10 #include "SkColorMatrixFilterRowMajor255.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 SkImageInfo::MakeA8(sizes[i].fWidth, sizes[i].fHeight), planes[i
], rb)); | 42 SkImageInfo::MakeA8(sizes[i].fWidth, sizes[i].fHeight), planes[i
], rb)); |
43 if (!surface) { | 43 if (!surface) { |
44 return false; | 44 return false; |
45 } | 45 } |
46 SkPaint paint; | 46 SkPaint paint; |
47 paint.setFilterQuality(kLow_SkFilterQuality); | 47 paint.setFilterQuality(kLow_SkFilterQuality); |
48 paint.setXfermodeMode(SkXfermode::kSrc_Mode); | 48 paint.setXfermodeMode(SkXfermode::kSrc_Mode); |
49 int rowStartIdx = 5 * i; | 49 int rowStartIdx = 5 * i; |
50 const SkScalar* row = kYUVColorSpaceInvMatrices[colorSpace] + rowStartId
x; | 50 const SkScalar* row = kYUVColorSpaceInvMatrices[colorSpace] + rowStartId
x; |
51 paint.setColorFilter( | 51 paint.setColorFilter( |
52 SkColorMatrixFilterRowMajor255::CreateSingleChannelOutput(row))-
>unref(); | 52 SkColorMatrixFilterRowMajor255::MakeSingleChannelOutput(row)); |
53 surface->getCanvas()->drawImageRect(image, SkIRect::MakeWH(image->width(
), image->height()), | 53 surface->getCanvas()->drawImageRect(image, SkIRect::MakeWH(image->width(
), image->height()), |
54 SkRect::MakeIWH(surface->width(), su
rface->height()), | 54 SkRect::MakeIWH(surface->width(), su
rface->height()), |
55 &paint); | 55 &paint); |
56 } | 56 } |
57 return true; | 57 return true; |
58 } | 58 } |
OLD | NEW |