summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-15 12:52:45 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-15 12:52:45 +0000
commit0023e8b1d2b5cf906e320267ab38d909b1700660 (patch)
tree900c4abd1b01a9e7b36a6f861d34f3003232aeb7 /cc
parente5c7a6d470fe15744cf13c0cddf30da19421cdbb (diff)
downloadchromium_src-0023e8b1d2b5cf906e320267ab38d909b1700660.zip
chromium_src-0023e8b1d2b5cf906e320267ab38d909b1700660.tar.gz
chromium_src-0023e8b1d2b5cf906e320267ab38d909b1700660.tar.bz2
cc: Remove OwnPtr from CCFrameRateCounter.
Instead use scoped_ptr from base/ library. BUG=154451 R=enne@chromium.org,jamesr@chromium.org Review URL: https://codereview.chromium.org/11150007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161850 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r--cc/debug_rect_history.cc7
-rw-r--r--cc/debug_rect_history.h9
-rw-r--r--cc/frame_rate_counter.cc5
-rw-r--r--cc/frame_rate_counter.h9
-rw-r--r--cc/layer_tree_host_impl.cc6
-rw-r--r--cc/layer_tree_host_impl.h13
-rw-r--r--cc/page_scale_animation.cc7
-rw-r--r--cc/page_scale_animation.h6
8 files changed, 33 insertions, 29 deletions
diff --git a/cc/debug_rect_history.cc b/cc/debug_rect_history.cc
index 7f3c2ea..d6f6133 100644
--- a/cc/debug_rect_history.cc
+++ b/cc/debug_rect_history.cc
@@ -14,6 +14,11 @@
namespace cc {
+// static
+scoped_ptr<CCDebugRectHistory> CCDebugRectHistory::create() {
+ return make_scoped_ptr(new CCDebugRectHistory());
+}
+
CCDebugRectHistory::CCDebugRectHistory()
{
}
@@ -115,6 +120,6 @@ void CCDebugRectHistory::saveOccludingRects(const Vector<IntRect>& occludingRect
m_debugRects.append(CCDebugRect(OccludingRectType, occludingRects[i]));
}
-} // namespace cc
+} // namespace cc
#endif // USE(ACCELERATED_COMPOSITING)
diff --git a/cc/debug_rect_history.h b/cc/debug_rect_history.h
index 1b03f34..d9ca449 100644
--- a/cc/debug_rect_history.h
+++ b/cc/debug_rect_history.h
@@ -8,9 +8,9 @@
#if USE(ACCELERATED_COMPOSITING)
#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
#include "FloatRect.h"
#include "IntRect.h"
-#include <wtf/PassOwnPtr.h>
#include <wtf/Vector.h>
#include <vector>
@@ -54,10 +54,7 @@ struct CCDebugRect {
// the appropriate CCLayerTreeSettings are enabled.
class CCDebugRectHistory {
public:
- static PassOwnPtr<CCDebugRectHistory> create()
- {
- return adoptPtr(new CCDebugRectHistory());
- }
+ static scoped_ptr<CCDebugRectHistory> create();
~CCDebugRectHistory();
@@ -80,7 +77,7 @@ private:
DISALLOW_COPY_AND_ASSIGN(CCDebugRectHistory);
};
-} // namespace cc
+} // namespace cc
#endif // USE(ACCELERATED_COMPOSITING)
diff --git a/cc/frame_rate_counter.cc b/cc/frame_rate_counter.cc
index d30aeed..e145c87 100644
--- a/cc/frame_rate_counter.cc
+++ b/cc/frame_rate_counter.cc
@@ -24,6 +24,11 @@ static inline int safeMod(int number, int modulus)
return (number + modulus) % modulus;
}
+// static
+scoped_ptr<CCFrameRateCounter> CCFrameRateCounter::create() {
+ return make_scoped_ptr(new CCFrameRateCounter());
+}
+
inline base::TimeDelta CCFrameRateCounter::frameInterval(int frameNumber) const
{
return m_timeStampHistory[frameIndex(frameNumber)] -
diff --git a/cc/frame_rate_counter.h b/cc/frame_rate_counter.h
index e4a954d..d3247a3 100644
--- a/cc/frame_rate_counter.h
+++ b/cc/frame_rate_counter.h
@@ -8,8 +8,8 @@
#if USE(ACCELERATED_COMPOSITING)
#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
#include "base/time.h"
-#include <wtf/PassOwnPtr.h>
namespace cc {
@@ -17,10 +17,7 @@ namespace cc {
// intelligently compute average frames per second (and standard deviation).
class CCFrameRateCounter {
public:
- static PassOwnPtr<CCFrameRateCounter> create()
- {
- return adoptPtr(new CCFrameRateCounter());
- }
+ static scoped_ptr<CCFrameRateCounter> create();
void markBeginningOfFrame(base::TimeTicks timestamp);
void markEndOfFrame();
@@ -66,7 +63,7 @@ private:
DISALLOW_COPY_AND_ASSIGN(CCFrameRateCounter);
};
-} // namespace cc
+} // namespace cc
#endif // USE(ACCELERATED_COMPOSITING)
diff --git a/cc/layer_tree_host_impl.cc b/cc/layer_tree_host_impl.cc
index b738e8b..f650538 100644
--- a/cc/layer_tree_host_impl.cc
+++ b/cc/layer_tree_host_impl.cc
@@ -158,9 +158,9 @@ WebTransformationMatrix CCPinchZoomViewport::implTransform() const
class CCLayerTreeHostImplTimeSourceAdapter : public CCTimeSourceClient {
public:
- static PassOwnPtr<CCLayerTreeHostImplTimeSourceAdapter> create(CCLayerTreeHostImpl* layerTreeHostImpl, PassRefPtr<CCDelayBasedTimeSource> timeSource)
+ static scoped_ptr<CCLayerTreeHostImplTimeSourceAdapter> create(CCLayerTreeHostImpl* layerTreeHostImpl, PassRefPtr<CCDelayBasedTimeSource> timeSource)
{
- return adoptPtr(new CCLayerTreeHostImplTimeSourceAdapter(layerTreeHostImpl, timeSource));
+ return make_scoped_ptr(new CCLayerTreeHostImplTimeSourceAdapter(layerTreeHostImpl, timeSource));
}
virtual ~CCLayerTreeHostImplTimeSourceAdapter()
{
@@ -1351,7 +1351,7 @@ void CCLayerTreeHostImpl::animatePageScale(double monotonicTime)
m_client->setNeedsRedrawOnImplThread();
if (m_pageScaleAnimation->isAnimationCompleteAtTime(monotonicTime)) {
- m_pageScaleAnimation.clear();
+ m_pageScaleAnimation.reset();
m_client->setNeedsCommitOnImplThread();
}
}
diff --git a/cc/layer_tree_host_impl.h b/cc/layer_tree_host_impl.h
index 297f619..3e81230 100644
--- a/cc/layer_tree_host_impl.h
+++ b/cc/layer_tree_host_impl.h
@@ -6,13 +6,14 @@
#define CCLayerTreeHostImpl_h
#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
#include "base/time.h"
#include "CCAnimationEvents.h"
#include "CCInputHandler.h"
#include "CCLayerSorter.h"
+#include "CCRenderer.h"
#include "CCRenderPass.h"
#include "CCRenderPassSink.h"
-#include "CCRenderer.h"
#include "SkColor.h"
#include <public/WebCompositorOutputSurfaceClient.h>
#include <wtf/PassOwnPtr.h>
@@ -329,10 +330,10 @@ private:
bool m_pinchGestureActive;
IntPoint m_previousPinchAnchor;
- OwnPtr<CCPageScaleAnimation> m_pageScaleAnimation;
+ scoped_ptr<CCPageScaleAnimation> m_pageScaleAnimation;
// This is used for ticking animations slowly when hidden.
- OwnPtr<CCLayerTreeHostImplTimeSourceAdapter> m_timeSourceClientAdapter;
+ scoped_ptr<CCLayerTreeHostImplTimeSourceAdapter> m_timeSourceClientAdapter;
CCLayerSorter m_layerSorter;
@@ -342,8 +343,8 @@ private:
CCPinchZoomViewport m_pinchZoomViewport;
- OwnPtr<CCFrameRateCounter> m_fpsCounter;
- OwnPtr<CCDebugRectHistory> m_debugRectHistory;
+ scoped_ptr<CCFrameRateCounter> m_fpsCounter;
+ scoped_ptr<CCDebugRectHistory> m_debugRectHistory;
size_t m_numImplThreadScrolls;
size_t m_numMainThreadScrolls;
@@ -351,6 +352,6 @@ private:
DISALLOW_COPY_AND_ASSIGN(CCLayerTreeHostImpl);
};
-};
+} // namespace cc
#endif
diff --git a/cc/page_scale_animation.cc b/cc/page_scale_animation.cc
index 12dda09..7a7ebfe 100644
--- a/cc/page_scale_animation.cc
+++ b/cc/page_scale_animation.cc
@@ -13,12 +13,11 @@
namespace cc {
-PassOwnPtr<CCPageScaleAnimation> CCPageScaleAnimation::create(const IntSize& scrollStart, float pageScaleStart, const IntSize& windowSize, const IntSize& contentSize, double startTime)
+scoped_ptr<CCPageScaleAnimation> CCPageScaleAnimation::create(const IntSize& scrollStart, float pageScaleStart, const IntSize& windowSize, const IntSize& contentSize, double startTime)
{
- return adoptPtr(new CCPageScaleAnimation(scrollStart, pageScaleStart, windowSize, contentSize, startTime));
+ return make_scoped_ptr(new CCPageScaleAnimation(scrollStart, pageScaleStart, windowSize, contentSize, startTime));
}
-
CCPageScaleAnimation::CCPageScaleAnimation(const IntSize& scrollStart, float pageScaleStart, const IntSize& windowSize, const IntSize& contentSize, double startTime)
: m_scrollStart(scrollStart)
, m_pageScaleStart(pageScaleStart)
@@ -156,4 +155,4 @@ float CCPageScaleAnimation::pageScaleAtRatio(float ratio) const
return m_pageScaleStart * diff;
}
-} // namespace cc
+} // namespace cc
diff --git a/cc/page_scale_animation.h b/cc/page_scale_animation.h
index f597026..a3634f3 100644
--- a/cc/page_scale_animation.h
+++ b/cc/page_scale_animation.h
@@ -5,8 +5,8 @@
#ifndef CCPageScaleAnimation_h
#define CCPageScaleAnimation_h
+#include "base/memory/scoped_ptr.h"
#include "IntSize.h"
-#include <wtf/PassOwnPtr.h>
namespace cc {
@@ -19,7 +19,7 @@ public:
// Construct with the starting page scale and scroll offset (which is in
// pageScaleStart space). The window size is the user-viewable area
// in pixels.
- static PassOwnPtr<CCPageScaleAnimation> create(const IntSize& scrollStart, float pageScaleStart, const IntSize& windowSize, const IntSize& contentSize, double startTime);
+ static scoped_ptr<CCPageScaleAnimation> create(const IntSize& scrollStart, float pageScaleStart, const IntSize& windowSize, const IntSize& contentSize, double startTime);
// The following methods initialize the animation. Call one of them
// immediately after construction to set the final scroll and page scale.
@@ -69,6 +69,6 @@ private:
double m_duration;
};
-} // namespace cc
+} // namespace cc
#endif