OLD | NEW |
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/web_contents/aura/gesture_nav_simple.h" | 5 #include "content/browser/web_contents/aura/gesture_nav_simple.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "cc/paint/paint_flags.h" | 10 #include "cc/paint/paint_flags.h" |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 canvas->DrawCircle(center_point, ripple_radius, ripple_flags); | 270 canvas->DrawCircle(center_point, ripple_radius, ripple_flags); |
271 | 271 |
272 // Draw the arrow background circle with the shadow. | 272 // Draw the arrow background circle with the shadow. |
273 cc::PaintFlags bg_flags; | 273 cc::PaintFlags bg_flags; |
274 bg_flags.setAntiAlias(true); | 274 bg_flags.setAntiAlias(true); |
275 bg_flags.setStyle(cc::PaintFlags::kFill_Style); | 275 bg_flags.setStyle(cc::PaintFlags::kFill_Style); |
276 bg_flags.setColor(kBackgroundColor); | 276 bg_flags.setColor(kBackgroundColor); |
277 gfx::ShadowValues shadow; | 277 gfx::ShadowValues shadow; |
278 shadow.emplace_back(gfx::Vector2d(0, kBgShadowOffsetY), kBgShadowBlurRadius, | 278 shadow.emplace_back(gfx::Vector2d(0, kBgShadowOffsetY), kBgShadowBlurRadius, |
279 kBgShadowColor); | 279 kBgShadowColor); |
280 bg_flags.setLooper(gfx::CreateShadowDrawLooperCorrectBlur(shadow)); | 280 bg_flags.setLooper(gfx::CreateShadowDrawLooper(shadow)); |
281 canvas->DrawCircle(center_point, kBackgroundRadius, bg_flags); | 281 canvas->DrawCircle(center_point, kBackgroundRadius, bg_flags); |
282 | 282 |
283 // Draw the arrow. | 283 // Draw the arrow. |
284 float arrow_x = center_point.x() - kArrowSize / 2.f; | 284 float arrow_x = center_point.x() - kArrowSize / 2.f; |
285 float arrow_y = center_point.y() - kArrowSize / 2.f; | 285 float arrow_y = center_point.y() - kArrowSize / 2.f; |
286 // Calculate the offset for the arrow relative to its circular background. | 286 // Calculate the offset for the arrow relative to its circular background. |
287 float arrow_x_offset = | 287 float arrow_x_offset = |
288 (1 - progress) * (-kBackgroundRadius + kArrowSize / 2.f); | 288 (1 - progress) * (-kBackgroundRadius + kArrowSize / 2.f); |
289 arrow_x += mode_ == OVERSCROLL_EAST ? arrow_x_offset : -arrow_x_offset; | 289 arrow_x += mode_ == OVERSCROLL_EAST ? arrow_x_offset : -arrow_x_offset; |
290 uint8_t arrow_alpha = | 290 uint8_t arrow_alpha = |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 // affordance layer (e.g. when the navigated-to page is displayed while the | 402 // affordance layer (e.g. when the navigated-to page is displayed while the |
403 // completion animation is in progress). So instead, it is installed on top of | 403 // completion animation is in progress). So instead, it is installed on top of |
404 // the content window as its sibling. Note that the affordance itself makes | 404 // the content window as its sibling. Note that the affordance itself makes |
405 // sure that its contents are clipped to the bounds given to it. | 405 // sure that its contents are clipped to the bounds given to it. |
406 ui::Layer* parent = window->layer()->parent(); | 406 ui::Layer* parent = window->layer()->parent(); |
407 parent->Add(affordance_->root_layer()); | 407 parent->Add(affordance_->root_layer()); |
408 parent->StackAtTop(affordance_->root_layer()); | 408 parent->StackAtTop(affordance_->root_layer()); |
409 } | 409 } |
410 | 410 |
411 } // namespace content | 411 } // namespace content |
OLD | NEW |