Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: cc/tiles/gpu_image_decode_controller.cc

Issue 1933723002: cc: Unittest for checking already failed image decode task. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@land_task_manager
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "cc/tiles/gpu_image_decode_controller.h" 5 #include "cc/tiles/gpu_image_decode_controller.h"
6 6
7 #include "base/memory/discardable_memory_allocator.h" 7 #include "base/memory/discardable_memory_allocator.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/numerics/safe_math.h" 9 #include "base/numerics/safe_math.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 images_pending_deletion_.clear(); 814 images_pending_deletion_.clear();
815 } 815 }
816 816
817 SkImageInfo GpuImageDecodeController::CreateImageInfoForDrawImage( 817 SkImageInfo GpuImageDecodeController::CreateImageInfoForDrawImage(
818 const DrawImage& draw_image) const { 818 const DrawImage& draw_image) const {
819 return SkImageInfo::Make( 819 return SkImageInfo::Make(
820 draw_image.image()->width(), draw_image.image()->height(), 820 draw_image.image()->width(), draw_image.image()->height(),
821 ResourceFormatToClosestSkColorType(format_), kPremul_SkAlphaType); 821 ResourceFormatToClosestSkColorType(format_), kPremul_SkAlphaType);
822 } 822 }
823 823
824 void GpuImageDecodeController::SetImageDecodingFailedForTesting(
825 const DrawImage& image) {
826 base::AutoLock lock(lock_);
827 auto found = image_data_.Peek(image.image()->uniqueID());
828 DCHECK(found != image_data_.end());
829 ImageData* image_data = found->second.get();
830 image_data->decode.decode_failure = true;
831 }
832
824 } // namespace cc 833 } // namespace cc
OLDNEW
« no previous file with comments | « cc/tiles/gpu_image_decode_controller.h ('k') | cc/tiles/gpu_image_decode_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698