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

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

Issue 723343002: Update from https://crrev.com/304121 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 (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"
11 #include "base/json/json_writer.h" 11 #include "base/json/json_writer.h"
12 #include "base/lazy_instance.h"
12 #include "base/logging.h" 13 #include "base/logging.h"
13 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
14 #include "cc/base/scoped_ptr_algorithm.h" 15 #include "cc/base/scoped_ptr_algorithm.h"
15 #include "cc/layers/content_layer.h" 16 #include "cc/layers/content_layer.h"
16 #include "cc/layers/delegated_renderer_layer.h" 17 #include "cc/layers/delegated_renderer_layer.h"
17 #include "cc/layers/nine_patch_layer.h" 18 #include "cc/layers/nine_patch_layer.h"
18 #include "cc/layers/picture_layer.h" 19 #include "cc/layers/picture_layer.h"
19 #include "cc/layers/solid_color_layer.h" 20 #include "cc/layers/solid_color_layer.h"
20 #include "cc/layers/surface_layer.h" 21 #include "cc/layers/surface_layer.h"
21 #include "cc/layers/texture_layer.h" 22 #include "cc/layers/texture_layer.h"
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 572
572 void Layer::SetShowSurface( 573 void Layer::SetShowSurface(
573 cc::SurfaceId id, 574 cc::SurfaceId id,
574 const cc::SurfaceLayer::SatisfyCallback& satisfy_callback, 575 const cc::SurfaceLayer::SatisfyCallback& satisfy_callback,
575 const cc::SurfaceLayer::RequireCallback& require_callback, 576 const cc::SurfaceLayer::RequireCallback& require_callback,
576 gfx::Size frame_size_in_dip) { 577 gfx::Size frame_size_in_dip) {
577 DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR); 578 DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR);
578 579
579 scoped_refptr<cc::SurfaceLayer> new_layer = 580 scoped_refptr<cc::SurfaceLayer> new_layer =
580 cc::SurfaceLayer::Create(satisfy_callback, require_callback); 581 cc::SurfaceLayer::Create(satisfy_callback, require_callback);
581 new_layer->SetSurfaceId(id); 582 new_layer->SetSurfaceId(id, 1.f, frame_size_in_dip);
582 SwitchToLayer(new_layer); 583 SwitchToLayer(new_layer);
583 surface_layer_ = new_layer; 584 surface_layer_ = new_layer;
584 585
585 frame_size_in_dip_ = frame_size_in_dip; 586 frame_size_in_dip_ = frame_size_in_dip;
586 RecomputeDrawsContentAndUVRect(); 587 RecomputeDrawsContentAndUVRect();
587 } 588 }
588 589
589 void Layer::SetShowSolidColorContent() { 590 void Layer::SetShowSolidColorContent() {
590 DCHECK_EQ(type_, LAYER_SOLID_COLOR); 591 DCHECK_EQ(type_, LAYER_SOLID_COLOR);
591 592
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
1046 children_.end(), 1047 children_.end(),
1047 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), 1048 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection),
1048 collection)); 1049 collection));
1049 } 1050 }
1050 1051
1051 bool Layer::IsAnimating() const { 1052 bool Layer::IsAnimating() const {
1052 return animator_.get() && animator_->is_animating(); 1053 return animator_.get() && animator_->is_animating();
1053 } 1054 }
1054 1055
1055 } // namespace ui 1056 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/float_animation_curve_adapter.cc ('k') | ui/compositor/transform_animation_curve_adapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698