OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 if (color_space) | 113 if (color_space) |
114 *color_space = kJPEG_SkYUVColorSpace; | 114 *color_space = kJPEG_SkYUVColorSpace; |
115 | 115 |
116 return frame_generator_->GetYUVComponentSizes(data_.Get(), size_info); | 116 return frame_generator_->GetYUVComponentSizes(data_.Get(), size_info); |
117 } | 117 } |
118 | 118 |
119 bool DecodingImageGenerator::onGetYUV8Planes(const SkYUVSizeInfo& size_info, | 119 bool DecodingImageGenerator::onGetYUV8Planes(const SkYUVSizeInfo& size_info, |
120 void* planes[3]) { | 120 void* planes[3]) { |
121 // YUV decoding does not currently support progressive decoding. See comment | 121 // YUV decoding does not currently support progressive decoding. See comment |
122 // in ImageFrameGenerator.h. | 122 // in ImageFrameGenerator.h. |
123 ASSERT(can_yuv_decode_ && all_data_received_); | 123 DCHECK(can_yuv_decode_); |
| 124 DCHECK(all_data_received_); |
124 | 125 |
125 TRACE_EVENT1("blink", "DecodingImageGenerator::getYUV8Planes", "frame index", | 126 TRACE_EVENT1("blink", "DecodingImageGenerator::getYUV8Planes", "frame index", |
126 static_cast<int>(frame_index_)); | 127 static_cast<int>(frame_index_)); |
127 | 128 |
128 PlatformInstrumentation::WillDecodeLazyPixelRef(uniqueID()); | 129 PlatformInstrumentation::WillDecodeLazyPixelRef(uniqueID()); |
129 bool decoded = | 130 bool decoded = |
130 frame_generator_->DecodeToYUV(data_.Get(), frame_index_, size_info.fSizes, | 131 frame_generator_->DecodeToYUV(data_.Get(), frame_index_, size_info.fSizes, |
131 planes, size_info.fWidthBytes); | 132 planes, size_info.fWidthBytes); |
132 PlatformInstrumentation::DidDecodeLazyPixelRef(); | 133 PlatformInstrumentation::DidDecodeLazyPixelRef(); |
133 | 134 |
(...skipping 21 matching lines...) Expand all Loading... |
155 ImageFrameGenerator::Create(SkISize::Make(size.Width(), size.Height()), | 156 ImageFrameGenerator::Create(SkISize::Make(size.Width(), size.Height()), |
156 false, decoder->GetColorBehavior()); | 157 false, decoder->GetColorBehavior()); |
157 if (!frame) | 158 if (!frame) |
158 return nullptr; | 159 return nullptr; |
159 | 160 |
160 return new DecodingImageGenerator(frame, info, segment_reader.Release(), true, | 161 return new DecodingImageGenerator(frame, info, segment_reader.Release(), true, |
161 0); | 162 0); |
162 } | 163 } |
163 | 164 |
164 } // namespace blink | 165 } // namespace blink |
OLD | NEW |