| Index: content/browser/android/edge_effect.cc
|
| diff --git a/content/browser/android/edge_effect.cc b/content/browser/android/edge_effect.cc
|
| index 94e5b512e20505bf5ad12c59f9258e88f9fa41b1..364852d7910b95a852e0dffd0706c183ca506905 100644
|
| --- a/content/browser/android/edge_effect.cc
|
| +++ b/content/browser/android/edge_effect.cc
|
| @@ -5,6 +5,7 @@
|
| #include "content/browser/android/edge_effect.h"
|
|
|
| #include "cc/layers/layer.h"
|
| +#include "content/browser/android/overscroll_glow.h"
|
|
|
| namespace content {
|
|
|
| @@ -143,27 +144,27 @@ void UpdateLayer(cc::Layer* layer,
|
|
|
| } // namespace
|
|
|
| -EdgeEffect::EdgeEffect(scoped_refptr<cc::Layer> edge,
|
| - scoped_refptr<cc::Layer> glow)
|
| - : edge_(edge)
|
| - , glow_(glow)
|
| - , edge_alpha_(0)
|
| - , edge_scale_y_(0)
|
| - , glow_alpha_(0)
|
| - , glow_scale_y_(0)
|
| - , edge_alpha_start_(0)
|
| - , edge_alpha_finish_(0)
|
| - , edge_scale_y_start_(0)
|
| - , edge_scale_y_finish_(0)
|
| - , glow_alpha_start_(0)
|
| - , glow_alpha_finish_(0)
|
| - , glow_scale_y_start_(0)
|
| - , glow_scale_y_finish_(0)
|
| - , state_(STATE_IDLE)
|
| - , pull_distance_(0) {
|
| +EdgeEffect::EdgeEffect(scoped_ptr<OverscrollGlowLayerWrapper> edge,
|
| + scoped_ptr<OverscrollGlowLayerWrapper> glow)
|
| + : edge_(edge.Pass()),
|
| + glow_(glow.Pass()),
|
| + edge_alpha_(0),
|
| + edge_scale_y_(0),
|
| + glow_alpha_(0),
|
| + glow_scale_y_(0),
|
| + edge_alpha_start_(0),
|
| + edge_alpha_finish_(0),
|
| + edge_scale_y_start_(0),
|
| + edge_scale_y_finish_(0),
|
| + glow_alpha_start_(0),
|
| + glow_alpha_finish_(0),
|
| + glow_scale_y_start_(0),
|
| + glow_scale_y_finish_(0),
|
| + state_(STATE_IDLE),
|
| + pull_distance_(0) {
|
| // Prevent the provided layers from drawing until the effect is activated.
|
| - DisableLayer(edge_.get());
|
| - DisableLayer(glow_.get());
|
| + DisableLayer(edge_->layer());
|
| + DisableLayer(glow_->layer());
|
| }
|
|
|
| EdgeEffect::~EdgeEffect() { }
|
| @@ -173,8 +174,8 @@ bool EdgeEffect::IsFinished() const {
|
| }
|
|
|
| void EdgeEffect::Finish() {
|
| - DisableLayer(edge_.get());
|
| - DisableLayer(glow_.get());
|
| + DisableLayer(edge_->layer());
|
| + DisableLayer(glow_->layer());
|
| pull_distance_ = 0;
|
| state_ = STATE_IDLE;
|
| }
|
| @@ -359,8 +360,8 @@ void EdgeEffect::ApplyToLayers(gfx::SizeF window_size,
|
| // An empty window size, while meaningless, is also relatively harmless, and
|
| // will simply prevent any drawing of the layers.
|
| if (window_size.IsEmpty()) {
|
| - DisableLayer(edge_.get());
|
| - DisableLayer(glow_.get());
|
| + DisableLayer(edge_->layer());
|
| + DisableLayer(glow_->layer());
|
| return;
|
| }
|
|
|
| @@ -368,13 +369,21 @@ void EdgeEffect::ApplyToLayers(gfx::SizeF window_size,
|
| const int scaled_glow_height = static_cast<int>(
|
| std::min(glow_height * glow_scale_y_ * kGlowHeightToWidthRatio * 0.6f,
|
| glow_height * kMaxGlowHeight) + 0.5f);
|
| - UpdateLayer(
|
| - glow_.get(), edge, window_size, offset, scaled_glow_height, glow_alpha_);
|
| + UpdateLayer(glow_->layer(),
|
| + edge,
|
| + window_size,
|
| + offset,
|
| + scaled_glow_height,
|
| + glow_alpha_);
|
|
|
| // Edge
|
| - const int scaled_edge_height = static_cast<int>(edge_height * edge_scale_y_);
|
| - UpdateLayer(
|
| - edge_.get(), edge, window_size, offset, scaled_edge_height, edge_alpha_);
|
| + const int scaled_edge_height = static_cast<int>(edge_height * edge_scale_y_);
|
| + UpdateLayer(edge_->layer(),
|
| + edge,
|
| + window_size,
|
| + offset,
|
| + scaled_edge_height,
|
| + edge_alpha_);
|
| }
|
|
|
| } // namespace content
|
|
|