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

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

Issue 93663004: [#2] Pass gfx structs by const ref (gfx::Rect, gfx::RectF) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT, fix builds on non-linux platforms! Created 6 years, 11 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
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_common.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <stack> 8 #include <stack>
9 #include <string> 9 #include <string>
10 10
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 DCHECK(proxy_->IsMainThread()); 464 DCHECK(proxy_->IsMainThread());
465 465
466 if (output_surface_lost_) 466 if (output_surface_lost_)
467 return; 467 return;
468 468
469 num_failed_recreate_attempts_ = 0; 469 num_failed_recreate_attempts_ = 0;
470 output_surface_lost_ = true; 470 output_surface_lost_ = true;
471 SetNeedsCommit(); 471 SetNeedsCommit();
472 } 472 }
473 473
474 bool LayerTreeHost::CompositeAndReadback(void* pixels, 474 bool LayerTreeHost::CompositeAndReadback(
475 gfx::Rect rect_in_device_viewport) { 475 void* pixels,
476 const gfx::Rect& rect_in_device_viewport) {
476 trigger_idle_updates_ = false; 477 trigger_idle_updates_ = false;
477 bool ret = proxy_->CompositeAndReadback(pixels, rect_in_device_viewport); 478 bool ret = proxy_->CompositeAndReadback(pixels, rect_in_device_viewport);
478 trigger_idle_updates_ = true; 479 trigger_idle_updates_ = true;
479 return ret; 480 return ret;
480 } 481 }
481 482
482 void LayerTreeHost::FinishAllRendering() { 483 void LayerTreeHost::FinishAllRendering() {
483 proxy_->FinishAllRendering(); 484 proxy_->FinishAllRendering();
484 } 485 }
485 486
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 535
535 void LayerTreeHost::SetNeedsFullTreeSync() { 536 void LayerTreeHost::SetNeedsFullTreeSync() {
536 needs_full_tree_sync_ = true; 537 needs_full_tree_sync_ = true;
537 SetNeedsCommit(); 538 SetNeedsCommit();
538 } 539 }
539 540
540 void LayerTreeHost::SetNeedsRedraw() { 541 void LayerTreeHost::SetNeedsRedraw() {
541 SetNeedsRedrawRect(gfx::Rect(device_viewport_size_)); 542 SetNeedsRedrawRect(gfx::Rect(device_viewport_size_));
542 } 543 }
543 544
544 void LayerTreeHost::SetNeedsRedrawRect(gfx::Rect damage_rect) { 545 void LayerTreeHost::SetNeedsRedrawRect(const gfx::Rect& damage_rect) {
545 proxy_->SetNeedsRedraw(damage_rect); 546 proxy_->SetNeedsRedraw(damage_rect);
546 } 547 }
547 548
548 bool LayerTreeHost::CommitRequested() const { 549 bool LayerTreeHost::CommitRequested() const {
549 return proxy_->CommitRequested(); 550 return proxy_->CommitRequested();
550 } 551 }
551 552
552 bool LayerTreeHost::BeginMainFrameRequested() const { 553 bool LayerTreeHost::BeginMainFrameRequested() const {
553 return proxy_->BeginMainFrameRequested(); 554 return proxy_->BeginMainFrameRequested();
554 } 555 }
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
1265 swap_promise_list_.push_back(swap_promise.Pass()); 1266 swap_promise_list_.push_back(swap_promise.Pass());
1266 } 1267 }
1267 1268
1268 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { 1269 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) {
1269 for (size_t i = 0; i < swap_promise_list_.size(); i++) 1270 for (size_t i = 0; i < swap_promise_list_.size(); i++)
1270 swap_promise_list_[i]->DidNotSwap(reason); 1271 swap_promise_list_[i]->DidNotSwap(reason);
1271 swap_promise_list_.clear(); 1272 swap_promise_list_.clear();
1272 } 1273 }
1273 1274
1274 } // namespace cc 1275 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698