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

Side by Side Diff: chrome/browser/android/compositor/layer/thumbnail_layer.cc

Issue 1101823002: CC Animations: Make LayerAnimationController creation optional (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Plumb LayerSettings parameter for cc::Layer construction. Created 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/android/compositor/layer/thumbnail_layer.h" 5 #include "chrome/browser/android/compositor/layer/thumbnail_layer.h"
6 6
7 #include "cc/layers/ui_resource_layer.h" 7 #include "cc/layers/ui_resource_layer.h"
8 #include "chrome/browser/android/compositor/layer/content_layer.h"
8 #include "chrome/browser/android/thumbnail/thumbnail.h" 9 #include "chrome/browser/android/thumbnail/thumbnail.h"
9 #include "ui/gfx/geometry/size_conversions.h" 10 #include "ui/gfx/geometry/size_conversions.h"
10 11
11 namespace chrome { 12 namespace chrome {
12 namespace android { 13 namespace android {
13 14
14 // static 15 // static
15 scoped_refptr<ThumbnailLayer> ThumbnailLayer::Create() { 16 scoped_refptr<ThumbnailLayer> ThumbnailLayer::Create() {
16 return make_scoped_refptr(new ThumbnailLayer()); 17 return make_scoped_refptr(new ThumbnailLayer());
17 } 18 }
(...skipping 24 matching lines...) Expand all
42 if (index >= parent->children().size()) 43 if (index >= parent->children().size())
43 parent->AddChild(layer_); 44 parent->AddChild(layer_);
44 else if (parent->child_at(index)->id() != layer_->id()) 45 else if (parent->child_at(index)->id() != layer_->id())
45 parent->ReplaceChild(parent->child_at(index), layer_); 46 parent->ReplaceChild(parent->child_at(index), layer_);
46 } 47 }
47 48
48 scoped_refptr<cc::Layer> ThumbnailLayer::layer() { 49 scoped_refptr<cc::Layer> ThumbnailLayer::layer() {
49 return layer_; 50 return layer_;
50 } 51 }
51 52
52 ThumbnailLayer::ThumbnailLayer() : layer_(cc::UIResourceLayer::Create()) { 53 ThumbnailLayer::ThumbnailLayer()
54 : layer_(
55 cc::UIResourceLayer::Create(ContentLayer::ContentLayerSettings())) {
53 layer_->SetIsDrawable(true); 56 layer_->SetIsDrawable(true);
54 } 57 }
55 58
56 ThumbnailLayer::~ThumbnailLayer() { 59 ThumbnailLayer::~ThumbnailLayer() {
57 } 60 }
58 61
59 void ThumbnailLayer::UpdateSizes(const gfx::SizeF& content_size, 62 void ThumbnailLayer::UpdateSizes(const gfx::SizeF& content_size,
60 const gfx::SizeF& resource_size) { 63 const gfx::SizeF& resource_size) {
61 if (content_size != content_size_ || resource_size != resource_size_) { 64 if (content_size != content_size_ || resource_size != resource_size_) {
62 content_size_ = content_size; 65 content_size_ = content_size;
63 resource_size_ = resource_size; 66 resource_size_ = resource_size;
64 Clip(last_clipping_); 67 Clip(last_clipping_);
65 } 68 }
66 } 69 }
67 70
68 } // namespace android 71 } // namespace android
69 } // namespace chrome 72 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698