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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 generator_->DecodeAndScale(segment_reader_.Get(), false, 0, ImageInfo(), | 185 generator_->DecodeAndScale(segment_reader_.Get(), false, 0, ImageInfo(), |
186 buffer, 100 * 4, | 186 buffer, 100 * 4, |
187 ImageDecoder::kAlphaPremultiplied); | 187 ImageDecoder::kAlphaPremultiplied); |
188 EXPECT_EQ(1, decode_request_count_); | 188 EXPECT_EQ(1, decode_request_count_); |
189 EXPECT_EQ(0, decoders_destroyed_); | 189 EXPECT_EQ(0, decoders_destroyed_); |
190 | 190 |
191 // LocalFrame can now be decoded completely. | 191 // LocalFrame can now be decoded completely. |
192 SetFrameStatus(ImageFrame::kFrameComplete); | 192 SetFrameStatus(ImageFrame::kFrameComplete); |
193 AddNewData(); | 193 AddNewData(); |
194 std::unique_ptr<WebThread> thread = | 194 std::unique_ptr<WebThread> thread = |
195 WTF::WrapUnique(Platform::Current()->CreateThread("DecodeThread")); | 195 Platform::Current()->CreateThread("DecodeThread"); |
196 thread->GetWebTaskRunner()->PostTask( | 196 thread->GetWebTaskRunner()->PostTask( |
197 BLINK_FROM_HERE, | 197 BLINK_FROM_HERE, |
198 CrossThreadBind(&DecodeThreadMain, generator_, segment_reader_)); | 198 CrossThreadBind(&DecodeThreadMain, generator_, segment_reader_)); |
199 thread.reset(); | 199 thread.reset(); |
200 EXPECT_EQ(2, decode_request_count_); | 200 EXPECT_EQ(2, decode_request_count_); |
201 EXPECT_EQ(1, decoders_destroyed_); | 201 EXPECT_EQ(1, decoders_destroyed_); |
202 | 202 |
203 // Decoder created again. | 203 // Decoder created again. |
204 generator_->DecodeAndScale(segment_reader_.Get(), false, 0, ImageInfo(), | 204 generator_->DecodeAndScale(segment_reader_.Get(), false, 0, ImageInfo(), |
205 buffer, 100 * 4, | 205 buffer, 100 * 4, |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 // ImageFrameGenerator::tryToResumeDecode(). | 267 // ImageFrameGenerator::tryToResumeDecode(). |
268 generator_->DecodeAndScale(segment_reader_.Get(), true, 2, ImageInfo(), | 268 generator_->DecodeAndScale(segment_reader_.Get(), true, 2, ImageInfo(), |
269 buffer, 100 * 4, | 269 buffer, 100 * 4, |
270 ImageDecoder::kAlphaPremultiplied); | 270 ImageDecoder::kAlphaPremultiplied); |
271 EXPECT_EQ(3, decode_request_count_); | 271 EXPECT_EQ(3, decode_request_count_); |
272 EXPECT_EQ(0, decoders_destroyed_); | 272 EXPECT_EQ(0, decoders_destroyed_); |
273 EXPECT_EQ(kNotFound, requested_clear_except_frame_); | 273 EXPECT_EQ(kNotFound, requested_clear_except_frame_); |
274 } | 274 } |
275 | 275 |
276 } // namespace blink | 276 } // namespace blink |
OLD | NEW |