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

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

Issue 464643003: Stop painting when receiving delegated frame (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix crashes Created 6 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
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 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 RecomputePosition(); 683 RecomputePosition();
684 SchedulePaint(gfx::Rect(bounds_.size())); 684 SchedulePaint(gfx::Rect(bounds_.size()));
685 if (delegate_) 685 if (delegate_)
686 delegate_->OnDeviceScaleFactorChanged(device_scale_factor); 686 delegate_->OnDeviceScaleFactorChanged(device_scale_factor);
687 for (size_t i = 0; i < children_.size(); ++i) 687 for (size_t i = 0; i < children_.size(); ++i)
688 children_[i]->OnDeviceScaleFactorChanged(device_scale_factor); 688 children_[i]->OnDeviceScaleFactorChanged(device_scale_factor);
689 if (layer_mask_) 689 if (layer_mask_)
690 layer_mask_->OnDeviceScaleFactorChanged(device_scale_factor); 690 layer_mask_->OnDeviceScaleFactorChanged(device_scale_factor);
691 } 691 }
692 692
693 void Layer::OnDelegatedFrameDamage(const gfx::Rect &damage_rect_in_dip) {
enne (OOO) 2014/08/21 20:54:19 piman, danakj: removed DCHECK about having a deleg
enne (OOO) 2014/08/22 17:26:04 danakj (or piman): PTAL?
694 if (!delegate_)
695 return;
696 delegate_->OnDelegatedFrameDamage(damage_rect_in_dip);
697 }
698
693 void Layer::RequestCopyOfOutput(scoped_ptr<cc::CopyOutputRequest> request) { 699 void Layer::RequestCopyOfOutput(scoped_ptr<cc::CopyOutputRequest> request) {
694 cc_layer_->RequestCopyOfOutput(request.Pass()); 700 cc_layer_->RequestCopyOfOutput(request.Pass());
695 } 701 }
696 702
697 void Layer::PaintContents(SkCanvas* sk_canvas, 703 void Layer::PaintContents(SkCanvas* sk_canvas,
698 const gfx::Rect& clip, 704 const gfx::Rect& clip,
699 gfx::RectF* opaque, 705 gfx::RectF* opaque,
700 ContentLayerClient::GraphicsContextStatus gc_status) { 706 ContentLayerClient::GraphicsContextStatus gc_status) {
701 TRACE_EVENT0("ui", "Layer::PaintContents"); 707 TRACE_EVENT0("ui", "Layer::PaintContents");
702 scoped_ptr<gfx::Canvas> canvas(gfx::Canvas::CreateCanvasWithoutScaling( 708 scoped_ptr<gfx::Canvas> canvas(gfx::Canvas::CreateCanvasWithoutScaling(
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
1028 children_.end(), 1034 children_.end(),
1029 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), 1035 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection),
1030 collection)); 1036 collection));
1031 } 1037 }
1032 1038
1033 bool Layer::IsAnimating() const { 1039 bool Layer::IsAnimating() const {
1034 return animator_ && animator_->is_animating(); 1040 return animator_ && animator_->is_animating();
1035 } 1041 }
1036 1042
1037 } // namespace ui 1043 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698