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

Side by Side Diff: cc/output/filter_operation.cc

Issue 23531053: ui/base/animation -> ui/gfx/animation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge 2 trunk Created 7 years, 3 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 | « ash/wm/workspace_controller.cc ('k') | chrome/browser/download/download_shelf.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <algorithm> 5 #include <algorithm>
6 6
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "cc/base/math_util.h" 8 #include "cc/base/math_util.h"
9 #include "cc/output/filter_operation.h" 9 #include "cc/output/filter_operation.h"
10 #include "third_party/skia/include/core/SkMath.h" 10 #include "third_party/skia/include/core/SkMath.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 FilterOperation::FilterOperation(FilterType type, float amount, int inset) 61 FilterOperation::FilterOperation(FilterType type, float amount, int inset)
62 : type_(type), 62 : type_(type),
63 amount_(amount), 63 amount_(amount),
64 drop_shadow_offset_(0, 0), 64 drop_shadow_offset_(0, 0),
65 drop_shadow_color_(0), 65 drop_shadow_color_(0),
66 zoom_inset_(inset) { 66 zoom_inset_(inset) {
67 DCHECK_EQ(type_, ZOOM); 67 DCHECK_EQ(type_, ZOOM);
68 memset(matrix_, 0, sizeof(matrix_)); 68 memset(matrix_, 0, sizeof(matrix_));
69 } 69 }
70 70
71 // TODO(ajuma): Define a version of ui::Tween::ValueBetween for floats, and use 71 // TODO(ajuma): Define a version of gfx::Tween::ValueBetween for floats, and use
72 // that instead. 72 // that instead.
73 static float BlendFloats(float from, float to, double progress) { 73 static float BlendFloats(float from, float to, double progress) {
74 return from * (1.0 - progress) + to * progress; 74 return from * (1.0 - progress) + to * progress;
75 } 75 }
76 76
77 static int BlendInts(int from, int to, double progress) { 77 static int BlendInts(int from, int to, double progress) {
78 return static_cast<int>( 78 return static_cast<int>(
79 MathUtil::Round(from * (1.0 - progress) + to * progress)); 79 MathUtil::Round(from * (1.0 - progress) + to * progress));
80 } 80 }
81 81
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 } 248 }
249 case FilterOperation::ZOOM: 249 case FilterOperation::ZOOM:
250 value->SetDouble("amount", amount_); 250 value->SetDouble("amount", amount_);
251 value->SetDouble("inset", zoom_inset_); 251 value->SetDouble("inset", zoom_inset_);
252 break; 252 break;
253 } 253 }
254 return value.PassAs<base::Value>(); 254 return value.PassAs<base::Value>();
255 } 255 }
256 256
257 } // namespace cc 257 } // namespace cc
OLDNEW
« no previous file with comments | « ash/wm/workspace_controller.cc ('k') | chrome/browser/download/download_shelf.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698