| 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 PaintCanvas* temp_canvas = recorder.beginRecording(100, 100); | 219 PaintCanvas* temp_canvas = recorder.beginRecording(100, 100); |
| 220 temp_canvas->drawImage( | 220 temp_canvas->drawImage( |
| 221 PaintImage(std::move(image), PaintImage::AnimationType::STATIC, | 221 PaintImage(std::move(image), PaintImage::AnimationType::STATIC, |
| 222 PaintImage::CompletionState::DONE), | 222 PaintImage::CompletionState::DONE), |
| 223 0, 0); | 223 0, 0); |
| 224 sk_sp<PaintRecord> record = recorder.finishRecordingAsPicture(); | 224 sk_sp<PaintRecord> record = recorder.finishRecordingAsPicture(); |
| 225 EXPECT_EQ(0, decode_request_count_); | 225 EXPECT_EQ(0, decode_request_count_); |
| 226 | 226 |
| 227 // Create a thread to rasterize PaintRecord. | 227 // Create a thread to rasterize PaintRecord. |
| 228 std::unique_ptr<WebThread> thread = | 228 std::unique_ptr<WebThread> thread = |
| 229 Platform::Current()->CreateThread("RasterThread"); | 229 WTF::WrapUnique(Platform::Current()->CreateThread("RasterThread")); |
| 230 thread->GetWebTaskRunner()->PostTask( | 230 thread->GetWebTaskRunner()->PostTask( |
| 231 BLINK_FROM_HERE, | 231 BLINK_FROM_HERE, |
| 232 CrossThreadBind(&RasterizeMain, CrossThreadUnretained(canvas_.get()), | 232 CrossThreadBind(&RasterizeMain, CrossThreadUnretained(canvas_.get()), |
| 233 record)); | 233 record)); |
| 234 thread.reset(); | 234 thread.reset(); |
| 235 EXPECT_EQ(0, decode_request_count_); | 235 EXPECT_EQ(0, decode_request_count_); |
| 236 EXPECT_EQ(SkColorSetARGB(255, 255, 255, 255), bitmap_.getColor(0, 0)); | 236 EXPECT_EQ(SkColorSetARGB(255, 255, 255, 255), bitmap_.getColor(0, 0)); |
| 237 } | 237 } |
| 238 | 238 |
| 239 TEST_F(DeferredImageDecoderTest, singleFrameImageLoading) { | 239 TEST_F(DeferredImageDecoderTest, singleFrameImageLoading) { |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 SharedBuffer::Create(data_->Data(), data_->size()); | 395 SharedBuffer::Create(data_->Data(), data_->size()); |
| 396 EXPECT_EQ(original_data->size(), data_->size()); | 396 EXPECT_EQ(original_data->size(), data_->size()); |
| 397 lazy_decoder_->SetData(original_data, false); | 397 lazy_decoder_->SetData(original_data, false); |
| 398 RefPtr<SharedBuffer> new_data = lazy_decoder_->Data(); | 398 RefPtr<SharedBuffer> new_data = lazy_decoder_->Data(); |
| 399 EXPECT_EQ(original_data->size(), new_data->size()); | 399 EXPECT_EQ(original_data->size(), new_data->size()); |
| 400 EXPECT_EQ(0, std::memcmp(original_data->Data(), new_data->Data(), | 400 EXPECT_EQ(0, std::memcmp(original_data->Data(), new_data->Data(), |
| 401 new_data->size())); | 401 new_data->size())); |
| 402 } | 402 } |
| 403 | 403 |
| 404 } // namespace blink | 404 } // namespace blink |
| OLD | NEW |