OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "platform/image-encoders/ImageEncoder.h" | 5 #include "platform/image-encoders/ImageEncoder.h" |
6 | 6 |
7 namespace blink { | 7 namespace blink { |
8 | 8 |
9 bool ImageEncoder::Encode(Vector<unsigned char>* dst, | 9 bool ImageEncoder::Encode(Vector<unsigned char>* dst, |
10 const SkPixmap& src, | 10 const SkPixmap& src, |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 options.fCompression = SkWebpEncoder::Compression::kLossless; | 74 options.fCompression = SkWebpEncoder::Compression::kLossless; |
75 options.fQuality = 75.0f; | 75 options.fQuality = 75.0f; |
76 } else { | 76 } else { |
77 options.fQuality = 80.0f; // Default value | 77 options.fQuality = 80.0f; // Default value |
78 if (0.0f <= quality && quality <= 1.0) | 78 if (0.0f <= quality && quality <= 1.0) |
79 options.fQuality = quality * 100.0f; | 79 options.fQuality = quality * 100.0f; |
80 } | 80 } |
81 | 81 |
82 return options; | 82 return options; |
83 } | 83 } |
84 }; | 84 }; // namespace blink |
OLD | NEW |