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

Side by Side Diff: cc/ScrollbarLayerChromium.cpp

Issue 11076013: [cc] Store CCLayerImpls as scoped_ptrs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/ScrollbarLayerChromium.h ('k') | cc/ScrollbarLayerChromiumTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "config.h" 5 #include "config.h"
6 6
7 #if USE(ACCELERATED_COMPOSITING) 7 #if USE(ACCELERATED_COMPOSITING)
8 8
9 #include "ScrollbarLayerChromium.h" 9 #include "ScrollbarLayerChromium.h"
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "CCLayerTreeHost.h" 12 #include "CCLayerTreeHost.h"
13 #include "CCScrollbarLayerImpl.h" 13 #include "CCScrollbarLayerImpl.h"
14 #include "CCTextureUpdateQueue.h" 14 #include "CCTextureUpdateQueue.h"
15 #include "LayerPainterChromium.h" 15 #include "LayerPainterChromium.h"
16 #include "TraceEvent.h" 16 #include "TraceEvent.h"
17 #include <public/WebRect.h> 17 #include <public/WebRect.h>
18 18
19 using WebKit::WebRect; 19 using WebKit::WebRect;
20 20
21 namespace cc { 21 namespace cc {
22 22
23 PassOwnPtr<CCLayerImpl> ScrollbarLayerChromium::createCCLayerImpl() 23 scoped_ptr<CCLayerImpl> ScrollbarLayerChromium::createCCLayerImpl()
24 { 24 {
25 return CCScrollbarLayerImpl::create(id()); 25 return CCScrollbarLayerImpl::create(id()).PassAs<CCLayerImpl>();
26 } 26 }
27 27
28 scoped_refptr<ScrollbarLayerChromium> ScrollbarLayerChromium::create(PassOwnPtr< WebKit::WebScrollbar> scrollbar, WebKit::WebScrollbarThemePainter painter, PassO wnPtr<WebKit::WebScrollbarThemeGeometry> geometry, int scrollLayerId) 28 scoped_refptr<ScrollbarLayerChromium> ScrollbarLayerChromium::create(PassOwnPtr< WebKit::WebScrollbar> scrollbar, WebKit::WebScrollbarThemePainter painter, PassO wnPtr<WebKit::WebScrollbarThemeGeometry> geometry, int scrollLayerId)
29 { 29 {
30 return make_scoped_refptr(new ScrollbarLayerChromium(scrollbar, painter, geo metry, scrollLayerId)); 30 return make_scoped_refptr(new ScrollbarLayerChromium(scrollbar, painter, geo metry, scrollLayerId));
31 } 31 }
32 32
33 ScrollbarLayerChromium::ScrollbarLayerChromium(PassOwnPtr<WebKit::WebScrollbar> scrollbar, WebKit::WebScrollbarThemePainter painter, PassOwnPtr<WebKit::WebScrol lbarThemeGeometry> geometry, int scrollLayerId) 33 ScrollbarLayerChromium::ScrollbarLayerChromium(PassOwnPtr<WebKit::WebScrollbar> scrollbar, WebKit::WebScrollbarThemePainter painter, PassOwnPtr<WebKit::WebScrol lbarThemeGeometry> geometry, int scrollLayerId)
34 : m_scrollbar(scrollbar) 34 : m_scrollbar(scrollbar)
35 , m_painter(painter) 35 , m_painter(painter)
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 283
284 // Consider the thumb to be at the origin when painting. 284 // Consider the thumb to be at the origin when painting.
285 WebKit::WebRect thumbRect = m_geometry->thumbRect(m_scrollbar.get()); 285 WebKit::WebRect thumbRect = m_geometry->thumbRect(m_scrollbar.get());
286 IntRect originThumbRect = layerRectToContentRect(WebKit::WebRect(0, 0, thumb Rect.width, thumbRect.height)); 286 IntRect originThumbRect = layerRectToContentRect(WebKit::WebRect(0, 0, thumb Rect.width, thumbRect.height));
287 if (!originThumbRect.isEmpty()) 287 if (!originThumbRect.isEmpty())
288 updatePart(m_thumbUpdater.get(), m_thumb.get(), originThumbRect, queue, stats); 288 updatePart(m_thumbUpdater.get(), m_thumb.get(), originThumbRect, queue, stats);
289 } 289 }
290 290
291 } 291 }
292 #endif // USE(ACCELERATED_COMPOSITING) 292 #endif // USE(ACCELERATED_COMPOSITING)
OLDNEW
« no previous file with comments | « cc/ScrollbarLayerChromium.h ('k') | cc/ScrollbarLayerChromiumTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698