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

Side by Side Diff: ui/compositor/layer.cc

Issue 23097005: cc: return resources via a ReturnedResource struct rather than TransferableResource (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review nits Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « ui/compositor/layer.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/compositor/layer.h" 5 #include "ui/compositor/layer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 SwitchToLayer(new_layer); 545 SwitchToLayer(new_layer);
546 content_layer_ = new_layer; 546 content_layer_ = new_layer;
547 } 547 }
548 } 548 }
549 if (has_frame) 549 if (has_frame)
550 delegated_renderer_layer_->SetFrameData(frame.Pass()); 550 delegated_renderer_layer_->SetFrameData(frame.Pass());
551 RecomputeDrawsContentAndUVRect(); 551 RecomputeDrawsContentAndUVRect();
552 } 552 }
553 553
554 void Layer::TakeUnusedResourcesForChildCompositor( 554 void Layer::TakeUnusedResourcesForChildCompositor(
555 cc::TransferableResourceArray* list) { 555 cc::ReturnedResourceArray* list) {
556 if (delegated_renderer_layer_.get()) 556 if (delegated_renderer_layer_.get())
557 delegated_renderer_layer_->TakeUnusedResourcesForChildCompositor(list); 557 delegated_renderer_layer_->TakeUnusedResourcesForChildCompositor(list);
558 } 558 }
559 559
560 void Layer::SetColor(SkColor color) { 560 void Layer::SetColor(SkColor color) {
561 GetAnimator()->SetColor(color); 561 GetAnimator()->SetColor(color);
562 } 562 }
563 563
564 bool Layer::SchedulePaint(const gfx::Rect& invalid_rect) { 564 bool Layer::SchedulePaint(const gfx::Rect& invalid_rect) {
565 if (type_ == LAYER_SOLID_COLOR || (!delegate_ && !texture_.get())) 565 if (type_ == LAYER_SOLID_COLOR || (!delegate_ && !texture_.get()))
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
964 cc_layer_->SetBounds(ConvertSizeToPixel(this, size)); 964 cc_layer_->SetBounds(ConvertSizeToPixel(this, size));
965 } 965 }
966 966
967 void Layer::RecomputePosition() { 967 void Layer::RecomputePosition() {
968 cc_layer_->SetPosition(gfx::ScalePoint( 968 cc_layer_->SetPosition(gfx::ScalePoint(
969 gfx::PointF(bounds_.x(), bounds_.y()), 969 gfx::PointF(bounds_.x(), bounds_.y()),
970 device_scale_factor_)); 970 device_scale_factor_));
971 } 971 }
972 972
973 } // namespace ui 973 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/layer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698