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

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 2769823002: Add decode() functionality to image elements. (Closed)
Patch Set: rebase + update 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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 2326 matching lines...) Expand 10 before | Expand all | Expand 10 after
2337 decoded_image_tracker_.QueueImageDecode( 2337 decoded_image_tracker_.QueueImageDecode(
2338 std::move(image), base::Bind(&LayerTreeHostImpl::ImageDecodeFinished, 2338 std::move(image), base::Bind(&LayerTreeHostImpl::ImageDecodeFinished,
2339 base::Unretained(this), embedder_callback)); 2339 base::Unretained(this), embedder_callback));
2340 } 2340 }
2341 2341
2342 void LayerTreeHostImpl::ImageDecodeFinished( 2342 void LayerTreeHostImpl::ImageDecodeFinished(
2343 const base::Callback<void(bool)>& embedder_callback, 2343 const base::Callback<void(bool)>& embedder_callback,
2344 bool decode_succeeded) { 2344 bool decode_succeeded) {
2345 completed_image_decode_callbacks_.emplace_back( 2345 completed_image_decode_callbacks_.emplace_back(
2346 base::Bind(embedder_callback, decode_succeeded)); 2346 base::Bind(embedder_callback, decode_succeeded));
2347 client_->SetNeedsCommitOnImplThread(); 2347 client_->NotifyImageDecodeRequestFinished();
2348 } 2348 }
2349 2349
2350 std::vector<base::Closure> 2350 std::vector<base::Closure>
2351 LayerTreeHostImpl::TakeCompletedImageDecodeCallbacks() { 2351 LayerTreeHostImpl::TakeCompletedImageDecodeCallbacks() {
2352 auto result = std::move(completed_image_decode_callbacks_); 2352 auto result = std::move(completed_image_decode_callbacks_);
2353 completed_image_decode_callbacks_.clear(); 2353 completed_image_decode_callbacks_.clear();
2354 return result; 2354 return result;
2355 } 2355 }
2356 2356
2357 void LayerTreeHostImpl::ClearImageCacheOnNavigation() { 2357 void LayerTreeHostImpl::ClearImageCacheOnNavigation() {
(...skipping 1945 matching lines...) Expand 10 before | Expand all | Expand 10 after
4303 4303
4304 void LayerTreeHostImpl::ShowScrollbarsForImplScroll(ElementId element_id) { 4304 void LayerTreeHostImpl::ShowScrollbarsForImplScroll(ElementId element_id) {
4305 if (!element_id) 4305 if (!element_id)
4306 return; 4306 return;
4307 if (ScrollbarAnimationController* animation_controller = 4307 if (ScrollbarAnimationController* animation_controller =
4308 ScrollbarAnimationControllerForElementId(element_id)) 4308 ScrollbarAnimationControllerForElementId(element_id))
4309 animation_controller->DidScrollUpdate(); 4309 animation_controller->DidScrollUpdate();
4310 } 4310 }
4311 4311
4312 } // namespace cc 4312 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698