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

Unified Diff: cc/CCScrollbarLayerImpl.cpp

Issue 11122003: [cc] Rename all cc/ filenames to Chromium style (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/CCScrollbarLayerImpl.h ('k') | cc/CCSettings.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/CCScrollbarLayerImpl.cpp
diff --git a/cc/CCScrollbarLayerImpl.cpp b/cc/CCScrollbarLayerImpl.cpp
deleted file mode 100644
index 8a832e7099f97f93f063db363803cd1908360b59..0000000000000000000000000000000000000000
--- a/cc/CCScrollbarLayerImpl.cpp
+++ /dev/null
@@ -1,206 +0,0 @@
-// Copyright 2012 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 "config.h"
-
-#if USE(ACCELERATED_COMPOSITING)
-
-#include "CCScrollbarLayerImpl.h"
-
-#include "CCQuadSink.h"
-#include "CCScrollbarAnimationController.h"
-#include "CCTextureDrawQuad.h"
-
-using WebKit::WebRect;
-using WebKit::WebScrollbar;
-
-namespace cc {
-
-scoped_ptr<CCScrollbarLayerImpl> CCScrollbarLayerImpl::create(int id)
-{
- return make_scoped_ptr(new CCScrollbarLayerImpl(id));
-}
-
-CCScrollbarLayerImpl::CCScrollbarLayerImpl(int id)
- : CCLayerImpl(id)
- , m_scrollbar(this)
- , m_backTrackResourceId(0)
- , m_foreTrackResourceId(0)
- , m_thumbResourceId(0)
- , m_scrollbarOverlayStyle(WebScrollbar::ScrollbarOverlayStyleDefault)
- , m_orientation(WebScrollbar::Horizontal)
- , m_controlSize(WebScrollbar::RegularScrollbar)
- , m_pressedPart(WebScrollbar::NoPart)
- , m_hoveredPart(WebScrollbar::NoPart)
- , m_isScrollableAreaActive(false)
- , m_isScrollViewScrollbar(false)
- , m_enabled(false)
- , m_isCustomScrollbar(false)
- , m_isOverlayScrollbar(false)
-{
-}
-
-CCScrollbarLayerImpl::~CCScrollbarLayerImpl()
-{
-}
-
-void CCScrollbarLayerImpl::setScrollbarGeometry(PassOwnPtr<CCScrollbarGeometryFixedThumb> geometry)
-{
- m_geometry = geometry;
-}
-
-void CCScrollbarLayerImpl::setScrollbarData(WebScrollbar* scrollbar)
-{
- m_scrollbarOverlayStyle = scrollbar->scrollbarOverlayStyle();
- m_orientation = scrollbar->orientation();
- m_controlSize = scrollbar->controlSize();
- m_pressedPart = scrollbar->pressedPart();
- m_hoveredPart = scrollbar->hoveredPart();
- m_isScrollableAreaActive = scrollbar->isScrollableAreaActive();
- m_isScrollViewScrollbar = scrollbar->isScrollViewScrollbar();
- m_enabled = scrollbar->enabled();
- m_isCustomScrollbar = scrollbar->isCustomScrollbar();
- m_isOverlayScrollbar = scrollbar->isOverlay();
-
- scrollbar->getTickmarks(m_tickmarks);
-
- m_geometry->update(scrollbar);
-}
-
-static FloatRect toUVRect(const WebRect& r, const IntRect& bounds)
-{
- return FloatRect(static_cast<float>(r.x) / bounds.width(), static_cast<float>(r.y) / bounds.height(),
- static_cast<float>(r.width) / bounds.width(), static_cast<float>(r.height) / bounds.height());
-}
-
-void CCScrollbarLayerImpl::appendQuads(CCQuadSink& quadSink, CCAppendQuadsData& appendQuadsData)
-{
- bool premultipledAlpha = false;
- bool flipped = false;
- FloatRect uvRect(0, 0, 1, 1);
- IntRect boundsRect(IntPoint(), bounds());
- IntRect contentBoundsRect(IntPoint(), contentBounds());
-
- CCSharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQuadState());
- appendDebugBorderQuad(quadSink, sharedQuadState, appendQuadsData);
-
- WebRect thumbRect, backTrackRect, foreTrackRect;
- m_geometry->splitTrack(&m_scrollbar, m_geometry->trackRect(&m_scrollbar), backTrackRect, thumbRect, foreTrackRect);
- if (!m_geometry->hasThumb(&m_scrollbar))
- thumbRect = WebRect();
-
- if (m_thumbResourceId && !thumbRect.isEmpty()) {
- scoped_ptr<CCTextureDrawQuad> quad = CCTextureDrawQuad::create(sharedQuadState, layerRectToContentRect(thumbRect), m_thumbResourceId, premultipledAlpha, uvRect, flipped);
- quad->setNeedsBlending();
- quadSink.append(quad.PassAs<CCDrawQuad>(), appendQuadsData);
- }
-
- if (!m_backTrackResourceId)
- return;
-
- // We only paint the track in two parts if we were given a texture for the forward track part.
- if (m_foreTrackResourceId && !foreTrackRect.isEmpty())
- quadSink.append(CCTextureDrawQuad::create(sharedQuadState, layerRectToContentRect(foreTrackRect), m_foreTrackResourceId, premultipledAlpha, toUVRect(foreTrackRect, boundsRect), flipped).PassAs<CCDrawQuad>(), appendQuadsData);
-
- // Order matters here: since the back track texture is being drawn to the entire contents rect, we must append it after the thumb and
- // fore track quads. The back track texture contains (and displays) the buttons.
- if (!contentBoundsRect.isEmpty())
- quadSink.append(CCTextureDrawQuad::create(sharedQuadState, IntRect(contentBoundsRect), m_backTrackResourceId, premultipledAlpha, uvRect, flipped).PassAs<CCDrawQuad>(), appendQuadsData);
-}
-
-void CCScrollbarLayerImpl::didLoseContext()
-{
- m_backTrackResourceId = 0;
- m_foreTrackResourceId = 0;
- m_thumbResourceId = 0;
-}
-
-bool CCScrollbarLayerImpl::CCScrollbar::isOverlay() const
-{
- return m_owner->m_isOverlayScrollbar;
-}
-
-int CCScrollbarLayerImpl::CCScrollbar::value() const
-{
- return m_owner->m_currentPos;
-}
-
-WebKit::WebPoint CCScrollbarLayerImpl::CCScrollbar::location() const
-{
- return WebKit::WebPoint();
-}
-
-WebKit::WebSize CCScrollbarLayerImpl::CCScrollbar::size() const
-{
- return WebKit::WebSize(m_owner->bounds().width(), m_owner->bounds().height());
-}
-
-bool CCScrollbarLayerImpl::CCScrollbar::enabled() const
-{
- return m_owner->m_enabled;
-}
-
-int CCScrollbarLayerImpl::CCScrollbar::maximum() const
-{
- return m_owner->m_maximum;
-}
-
-int CCScrollbarLayerImpl::CCScrollbar::totalSize() const
-{
- return m_owner->m_totalSize;
-}
-
-bool CCScrollbarLayerImpl::CCScrollbar::isScrollViewScrollbar() const
-{
- return m_owner->m_isScrollViewScrollbar;
-}
-
-bool CCScrollbarLayerImpl::CCScrollbar::isScrollableAreaActive() const
-{
- return m_owner->m_isScrollableAreaActive;
-}
-
-void CCScrollbarLayerImpl::CCScrollbar::getTickmarks(WebKit::WebVector<WebRect>& tickmarks) const
-{
- tickmarks = m_owner->m_tickmarks;
-}
-
-WebScrollbar::ScrollbarControlSize CCScrollbarLayerImpl::CCScrollbar::controlSize() const
-{
- return m_owner->m_controlSize;
-}
-
-WebScrollbar::ScrollbarPart CCScrollbarLayerImpl::CCScrollbar::pressedPart() const
-{
- return m_owner->m_pressedPart;
-}
-
-WebScrollbar::ScrollbarPart CCScrollbarLayerImpl::CCScrollbar::hoveredPart() const
-{
- return m_owner->m_hoveredPart;
-}
-
-WebScrollbar::ScrollbarOverlayStyle CCScrollbarLayerImpl::CCScrollbar::scrollbarOverlayStyle() const
-{
- return m_owner->m_scrollbarOverlayStyle;
-}
-
-WebScrollbar::Orientation CCScrollbarLayerImpl::CCScrollbar::orientation() const
-{
- return m_owner->m_orientation;
-}
-
-bool CCScrollbarLayerImpl::CCScrollbar::isCustomScrollbar() const
-{
- return m_owner->m_isCustomScrollbar;
-}
-
-const char* CCScrollbarLayerImpl::layerTypeAsString() const
-{
- return "ScrollbarLayer";
-}
-
-}
-
-#endif // USE(ACCELERATED_COMPOSITING)
« no previous file with comments | « cc/CCScrollbarLayerImpl.h ('k') | cc/CCSettings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698