forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert 245663 "Revert 245645 "Define WebScrollOffsetAnimationCur..."
> Revert 245645 "Define WebScrollOffsetAnimationCurveImpl" > > Broke compositor_unittests on Linux Aura Tests with error: I'm a dirty liar. > > LayerWithRealCompositorTest.DrawPixels (run chromium#1): > [ RUN ] LayerWithRealCompositorTest.DrawPixels > ../../ui/compositor/layer_unittest.cc:832: Failure > Value of: ReadPixels(&bitmap, gfx::Rect(viewport_size)) > Actual: false > Expected: true > [ FAILED ] LayerWithRealCompositorTest.DrawPixels (246 ms) > > LayerWithRealCompositorTest.DrawPixels (run chromium#2): > [ RUN ] LayerWithRealCompositorTest.DrawPixels > ../../ui/compositor/layer_unittest.cc:832: Failure > Value of: ReadPixels(&bitmap, gfx::Rect(viewport_size)) > Actual: false > Expected: true > [ FAILED ] LayerWithRealCompositorTest.DrawPixels (272 ms) > > LayerWithRealCompositorTest.DrawPixels (run chromium#3): > [ RUN ] LayerWithRealCompositorTest.DrawPixels > ../../ui/compositor/layer_unittest.cc:832: Failure > Value of: ReadPixels(&bitmap, gfx::Rect(viewport_size)) > Actual: false > Expected: true > [ FAILED ] LayerWithRealCompositorTest.DrawPixels (259 ms) > > LayerWithRealCompositorTest.DrawPixels (run chromium#4): > [ RUN ] LayerWithRealCompositorTest.DrawPixels > ../../ui/compositor/layer_unittest.cc:832: Failure > Value of: ReadPixels(&bitmap, gfx::Rect(viewport_size)) > Actual: false > Expected: true > [ FAILED ] LayerWithRealCompositorTest.DrawPixels (229 ms) > > > Define WebScrollOffsetAnimationCurveImpl > > > > This defines WebScrollOffsetAnimationCurveImpl, which wraps a > > cc::ScrollOffsetAnimationCurve. This is needed for > > implementing the CSSOM Smooth Scroll API. > > > > BUG=243871 > > > > Review URL: https://codereview.chromium.org/112933005 > > TBR=ajuma@chromium.org > > Review URL: https://codereview.chromium.org/141753007 TBR=dbeam@chromium.org Review URL: https://codereview.chromium.org/141953013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245674 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
dbeam@chromium.org
committed
Jan 18, 2014
1 parent
3f52559
commit 429b588
Showing
8 changed files
with
141 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
webkit/renderer/compositor_bindings/web_scroll_offset_animation_curve_impl.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// Copyright 2014 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "webkit/renderer/compositor_bindings/web_scroll_offset_animation_curve_impl.h" | ||
|
||
#if WEB_SCROLL_OFFSET_ANIMATION_CURVE_IS_DEFINED | ||
|
||
#include "cc/animation/scroll_offset_animation_curve.h" | ||
#include "cc/animation/timing_function.h" | ||
#include "webkit/renderer/compositor_bindings/web_animation_curve_common.h" | ||
|
||
using blink::WebFloatPoint; | ||
|
||
namespace webkit { | ||
|
||
WebScrollOffsetAnimationCurveImpl::WebScrollOffsetAnimationCurveImpl( | ||
WebFloatPoint target_value, | ||
TimingFunctionType timing_function) | ||
: curve_(cc::ScrollOffsetAnimationCurve::Create( | ||
gfx::Vector2dF(target_value.x, target_value.y), | ||
CreateTimingFunction(timing_function))) {} | ||
|
||
WebScrollOffsetAnimationCurveImpl::~WebScrollOffsetAnimationCurveImpl() {} | ||
|
||
blink::WebAnimationCurve::AnimationCurveType | ||
WebScrollOffsetAnimationCurveImpl::type() const { | ||
return WebAnimationCurve::AnimationCurveTypeScrollOffset; | ||
} | ||
|
||
void WebScrollOffsetAnimationCurveImpl::setInitialValue( | ||
WebFloatPoint initial_value) { | ||
curve_->SetInitialValue(gfx::Vector2dF(initial_value.x, initial_value.y)); | ||
} | ||
|
||
WebFloatPoint WebScrollOffsetAnimationCurveImpl::getValue(double time) const { | ||
gfx::Vector2dF value = curve_->GetValue(time); | ||
return WebFloatPoint(value.x(), value.y()); | ||
} | ||
|
||
double WebScrollOffsetAnimationCurveImpl::duration() const { | ||
return curve_->Duration(); | ||
} | ||
|
||
scoped_ptr<cc::AnimationCurve> | ||
WebScrollOffsetAnimationCurveImpl::CloneToAnimationCurve() const { | ||
return curve_->Clone(); | ||
} | ||
|
||
} // namespace webkit | ||
|
||
#endif // WEB_SCROLL_OFFSET_ANIMATION_CURVE_IS_DEFINED |
51 changes: 51 additions & 0 deletions
51
webkit/renderer/compositor_bindings/web_scroll_offset_animation_curve_impl.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright 2014 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef WEBKIT_RENDERER_COMPOSITOR_BINDINGS_WEB_SCROLL_OFFSET_ANIMATION_CURVE_IMPL_H_ | ||
#define WEBKIT_RENDERER_COMPOSITOR_BINDINGS_WEB_SCROLL_OFFSET_ANIMATION_CURVE_IMPL_H_ | ||
|
||
#include "third_party/WebKit/public/platform/WebAnimationCurve.h" | ||
|
||
#if WEB_SCROLL_OFFSET_ANIMATION_CURVE_IS_DEFINED | ||
|
||
#include "base/memory/scoped_ptr.h" | ||
#include "third_party/WebKit/public/platform/WebScrollOffsetAnimationCurve.h" | ||
#include "webkit/renderer/compositor_bindings/webkit_compositor_bindings_export.h" | ||
|
||
namespace cc { | ||
class AnimationCurve; | ||
class ScrollOffsetAnimationCurve; | ||
} | ||
|
||
namespace webkit { | ||
|
||
class WebScrollOffsetAnimationCurveImpl | ||
: public blink::WebScrollOffsetAnimationCurve { | ||
public: | ||
WEBKIT_COMPOSITOR_BINDINGS_EXPORT WebScrollOffsetAnimationCurveImpl( | ||
blink::WebFloatPoint target_value, | ||
TimingFunctionType timing_function); | ||
virtual ~WebScrollOffsetAnimationCurveImpl(); | ||
|
||
// blink::WebAnimationCurve implementation. | ||
virtual AnimationCurveType type() const; | ||
|
||
// blink::WebScrollOffsetAnimationCurve implementation. | ||
virtual void setInitialValue(blink::WebFloatPoint initial_value); | ||
virtual blink::WebFloatPoint getValue(double time) const; | ||
virtual double duration() const; | ||
|
||
scoped_ptr<cc::AnimationCurve> CloneToAnimationCurve() const; | ||
|
||
private: | ||
scoped_ptr<cc::ScrollOffsetAnimationCurve> curve_; | ||
|
||
DISALLOW_COPY_AND_ASSIGN(WebScrollOffsetAnimationCurveImpl); | ||
}; | ||
|
||
} // namespace webkit | ||
|
||
#endif // WEB_SCROLL_OFFSET_ANIMATION_CURVE_IS_DEFINED | ||
|
||
#endif // WEBKIT_RENDERER_COMPOSITOR_BINDINGS_WEB_SCROLL_OFFSET_ANIMATION_CURVE_IMPL_H_ |