Chromium Code Reviews| 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 "blimp/engine/renderer/engine_image_serialization_processor.h" | 5 #include "blimp/engine/renderer/engine_image_serialization_processor.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 60 std::vector<unsigned char> data; | 60 std::vector<unsigned char> data; |
| 61 picture.custom_ptr = &data; | 61 picture.custom_ptr = &data; |
| 62 | 62 |
| 63 // Use our own WebPWriterFunction implementation. | 63 // Use our own WebPWriterFunction implementation. |
| 64 picture.writer = &WebPImageEncoder::WriteOutput; | 64 picture.writer = &WebPImageEncoder::WriteOutput; |
| 65 | 65 |
| 66 // Setup the configuration for the output WebP picture. This is currently | 66 // Setup the configuration for the output WebP picture. This is currently |
| 67 // the same as the default configuration for WebP, but since any change in | 67 // the same as the default configuration for WebP, but since any change in |
| 68 // the WebP defaults would invalidate all caches they are hard coded. | 68 // the WebP defaults would invalidate all caches they are hard coded. |
| 69 config.quality = 75.0; // between 0 (smallest file) and 100 (biggest). | 69 config.quality = 75.0; // between 0 (smallest file) and 100 (biggest). |
| 70 config.method = 4; // quality/speed trade-off (0=fast, 6=slower-better). | 70 config.method = 0; // quality/speed trade-off (0=fast, 6=slower-better). |
|
nyquist
2016/04/14 17:19:30
I discussed this with urvang@ in patch set 5 of ht
urvang
2016/04/14 17:41:16
I understand that this is a temporary solution bef
Khushal
2016/04/14 18:46:24
Thanks for the suggestion Urvang. I tried using mu
| |
| 71 | 71 |
| 72 // Encode the picture using the given configuration. | 72 // Encode the picture using the given configuration. |
| 73 bool success = WebPEncode(&config, &picture); | 73 bool success = WebPEncode(&config, &picture); |
| 74 | 74 |
| 75 // Release the memory allocated by WebPPictureImport*(). This does not free | 75 // Release the memory allocated by WebPPictureImport*(). This does not free |
| 76 // the memory used by the picture object itself. | 76 // the memory used by the picture object itself. |
| 77 WebPPictureFree(&picture); | 77 WebPPictureFree(&picture); |
| 78 | 78 |
| 79 if (!success) | 79 if (!success) |
| 80 return nullptr; | 80 return nullptr; |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 160 return pixel_serializer_.get(); | 160 return pixel_serializer_.get(); |
| 161 } | 161 } |
| 162 | 162 |
| 163 SkPicture::InstallPixelRefProc | 163 SkPicture::InstallPixelRefProc |
| 164 EngineImageSerializationProcessor::GetPixelDeserializer() { | 164 EngineImageSerializationProcessor::GetPixelDeserializer() { |
| 165 return nullptr; | 165 return nullptr; |
| 166 } | 166 } |
| 167 | 167 |
| 168 } // namespace engine | 168 } // namespace engine |
| 169 } // namespace blimp | 169 } // namespace blimp |
| OLD | NEW |