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

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

Issue 2904743002: cc: Add UMA for tracking decode duration for out of raster decodes. (Closed)
Patch Set: .. Created 3 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/checker_image_tracker.h" 5 #include "cc/tiles/checker_image_tracker.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 29 matching lines...) Expand all
40 return decodes_requested_; 40 return decodes_requested_;
41 } 41 }
42 42
43 void UnlockImageDecode(ImageDecodeRequestId id) override { 43 void UnlockImageDecode(ImageDecodeRequestId id) override {
44 DCHECK_EQ(locked_images_.count(id), 1U); 44 DCHECK_EQ(locked_images_.count(id), 1U);
45 locked_images_.erase(id); 45 locked_images_.erase(id);
46 } 46 }
47 47
48 ImageDecodeRequestId QueueImageDecode( 48 ImageDecodeRequestId QueueImageDecode(
49 sk_sp<const SkImage> image, 49 sk_sp<const SkImage> image,
50 const ImageDecodedCallback& callback) override { 50 const ImageDecodedCallback& callback,
51 ImageDecodeCache::ImageDecodeType type) override {
51 ImageDecodeRequestId request_id = next_image_request_id_++; 52 ImageDecodeRequestId request_id = next_image_request_id_++;
52 53
53 decodes_requested_.insert(image->uniqueID()); 54 decodes_requested_.insert(image->uniqueID());
54 locked_images_.insert(request_id); 55 locked_images_.insert(request_id);
55 56
56 // Post the callback asynchronously to match the behaviour in 57 // Post the callback asynchronously to match the behaviour in
57 // ImageController. 58 // ImageController.
58 worker_task_runner_->PostTask( 59 worker_task_runner_->PostTask(
59 FROM_HERE, 60 FROM_HERE,
60 base::BindOnce(callback, request_id, ImageDecodeResult::SUCCESS)); 61 base::BindOnce(callback, request_id, ImageDecodeResult::SUCCESS));
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 gfx::Size image_size = gfx::Size(partial_image.sk_image()->width(), 412 gfx::Size image_size = gfx::Size(partial_image.sk_image()->width(),
412 partial_image.sk_image()->height()); 413 partial_image.sk_image()->height());
413 PaintImage completed_paint_image = 414 PaintImage completed_paint_image =
414 PaintImage(partial_image.stable_id(), CreateDiscardableImage(image_size)); 415 PaintImage(partial_image.stable_id(), CreateDiscardableImage(image_size));
415 EXPECT_FALSE(checker_image_tracker_->ShouldCheckerImage( 416 EXPECT_FALSE(checker_image_tracker_->ShouldCheckerImage(
416 completed_paint_image, WhichTree::PENDING_TREE)); 417 completed_paint_image, WhichTree::PENDING_TREE));
417 } 418 }
418 419
419 } // namespace 420 } // namespace
420 } // namespace cc 421 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698