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

Side by Side Diff: ash/touch/touch_hud_projection.cc

Issue 291843003: use simpler gradient factories (in prep for removing SkUnitMapper param) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/web_contents/aura/shadow_layer_delegate.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 "ash/touch/touch_hud_projection.h" 5 #include "ash/touch/touch_hud_projection.h"
6 6
7 #include "ash/root_window_controller.h" 7 #include "ash/root_window_controller.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "third_party/skia/include/effects/SkGradientShader.h" 9 #include "third_party/skia/include/effects/SkGradientShader.h"
10 #include "ui/events/event.h" 10 #include "ui/events/event.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 if (fadeout_) 83 if (fadeout_)
84 alpha = static_cast<int>(fadeout_->CurrentValueBetween(alpha, 0)); 84 alpha = static_cast<int>(fadeout_->CurrentValueBetween(alpha, 0));
85 fill_paint_.setAlpha(alpha); 85 fill_paint_.setAlpha(alpha);
86 stroke_paint_.setAlpha(alpha); 86 stroke_paint_.setAlpha(alpha);
87 SkShader* shader = SkGradientShader::CreateRadial( 87 SkShader* shader = SkGradientShader::CreateRadial(
88 gradient_center_, 88 gradient_center_,
89 SkIntToScalar(kPointRadius), 89 SkIntToScalar(kPointRadius),
90 gradient_colors_, 90 gradient_colors_,
91 gradient_pos_, 91 gradient_pos_,
92 arraysize(gradient_colors_), 92 arraysize(gradient_colors_),
93 SkShader::kMirror_TileMode, 93 SkShader::kMirror_TileMode);
94 NULL);
95 fill_paint_.setShader(shader); 94 fill_paint_.setShader(shader);
96 shader->unref(); 95 shader->unref();
97 canvas->DrawCircle(circle_center_, SkIntToScalar(kPointRadius), 96 canvas->DrawCircle(circle_center_, SkIntToScalar(kPointRadius),
98 fill_paint_); 97 fill_paint_);
99 canvas->DrawCircle(circle_center_, SkIntToScalar(kPointRadius), 98 canvas->DrawCircle(circle_center_, SkIntToScalar(kPointRadius),
100 stroke_paint_); 99 stroke_paint_);
101 } 100 }
102 101
103 // Overridden from gfx::AnimationDelegate. 102 // Overridden from gfx::AnimationDelegate.
104 virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE { 103 virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 RootWindowController* controller) { 177 RootWindowController* controller) {
179 controller->set_touch_hud_projection(this); 178 controller->set_touch_hud_projection(this);
180 } 179 }
181 180
182 void TouchHudProjection::UnsetHudForRootWindowController( 181 void TouchHudProjection::UnsetHudForRootWindowController(
183 RootWindowController* controller) { 182 RootWindowController* controller) {
184 controller->set_touch_hud_projection(NULL); 183 controller->set_touch_hud_projection(NULL);
185 } 184 }
186 185
187 } // namespace ash 186 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | content/browser/web_contents/aura/shadow_layer_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698