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

Side by Side Diff: content/browser/android/edge_effect_l.cc

Issue 747683002: [Android] Clean up for UIResourceLayer use in EffectLayer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | « content/browser/android/edge_effect.cc ('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 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 "content/browser/android/edge_effect_l.h" 5 #include "content/browser/android/edge_effect_l.h"
6 6
7 #include "cc/layers/ui_resource_layer.h" 7 #include "cc/layers/ui_resource_layer.h"
8 #include "content/browser/android/animation_utils.h" 8 #include "content/browser/android/animation_utils.h"
9 #include "ui/base/android/system_ui_resource_manager.h" 9 #include "ui/base/android/system_ui_resource_manager.h"
10 10
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 const float image_offset_x = (bounds_.width() - image_bounds.width()) * 0.5f; 245 const float image_offset_x = (bounds_.width() - image_bounds.width()) * 0.5f;
246 gfx::Transform offset_transform; 246 gfx::Transform offset_transform;
247 offset_transform.Translate(image_offset_x - displacement_offset_x, 0); 247 offset_transform.Translate(image_offset_x - displacement_offset_x, 0);
248 offset_transform.ConcatTransform(transform); 248 offset_transform.ConcatTransform(transform);
249 glow_->SetTransform(offset_transform); 249 glow_->SetTransform(offset_transform);
250 } 250 }
251 251
252 void EdgeEffectL::SetParent(cc::Layer* parent) { 252 void EdgeEffectL::SetParent(cc::Layer* parent) {
253 if (glow_->parent() != parent) 253 if (glow_->parent() != parent)
254 parent->AddChild(glow_); 254 parent->AddChild(glow_);
255 glow_->SetUIResourceId(resource_manager_->GetUIResourceId(kResourceType));
256 } 255 }
257 256
258 // static 257 // static
259 void EdgeEffectL::PreloadResources( 258 void EdgeEffectL::PreloadResources(
260 ui::SystemUIResourceManager* resource_manager) { 259 ui::SystemUIResourceManager* resource_manager) {
261 DCHECK(resource_manager); 260 DCHECK(resource_manager);
262 resource_manager->PreloadResource(kResourceType); 261 resource_manager->PreloadResource(kResourceType);
263 } 262 }
264 263
265 } // namespace content 264 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/android/edge_effect.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698