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

Side by Side Diff: cc/content_layer.cc

Issue 11266030: Use gfx:: Geometry types for the resource provider and layer updater classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: uint8 Created 8 years, 1 month 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/content_layer.h ('k') | cc/content_layer_client.h » ('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 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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 #include "cc/content_layer.h" 7 #include "cc/content_layer.h"
8 8
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/time.h" 10 #include "base/time.h"
11 #include "cc/bitmap_content_layer_updater.h" 11 #include "cc/bitmap_content_layer_updater.h"
12 #include "cc/bitmap_skpicture_content_layer_updater.h" 12 #include "cc/bitmap_skpicture_content_layer_updater.h"
13 #include "cc/content_layer_client.h" 13 #include "cc/content_layer_client.h"
14 #include "cc/layer_painter.h" 14 #include "cc/layer_painter.h"
15 #include "cc/layer_tree_host.h" 15 #include "cc/layer_tree_host.h"
16 #include "cc/settings.h" 16 #include "cc/settings.h"
17 17
18 namespace cc { 18 namespace cc {
19 19
20 ContentLayerPainter::ContentLayerPainter(ContentLayerClient* client) 20 ContentLayerPainter::ContentLayerPainter(ContentLayerClient* client)
21 : m_client(client) 21 : m_client(client)
22 { 22 {
23 } 23 }
24 24
25 scoped_ptr<ContentLayerPainter> ContentLayerPainter::create(ContentLayerClient* client) 25 scoped_ptr<ContentLayerPainter> ContentLayerPainter::create(ContentLayerClient* client)
26 { 26 {
27 return make_scoped_ptr(new ContentLayerPainter(client)); 27 return make_scoped_ptr(new ContentLayerPainter(client));
28 } 28 }
29 29
30 void ContentLayerPainter::paint(SkCanvas* canvas, const IntRect& contentRect, Fl oatRect& opaque) 30 void ContentLayerPainter::paint(SkCanvas* canvas, const gfx::Rect& contentRect, gfx::RectF& opaque)
31 { 31 {
32 base::TimeTicks paintStart = base::TimeTicks::HighResNow(); 32 base::TimeTicks paintStart = base::TimeTicks::HighResNow();
33 m_client->paintContents(canvas, contentRect, opaque); 33 m_client->paintContents(canvas, contentRect, opaque);
34 base::TimeTicks paintEnd = base::TimeTicks::HighResNow(); 34 base::TimeTicks paintEnd = base::TimeTicks::HighResNow();
35 double pixelsPerSec = (contentRect.width() * contentRect.height()) / (paintE nd - paintStart).InSecondsF(); 35 double pixelsPerSec = (contentRect.width() * contentRect.height()) / (paintE nd - paintStart).InSecondsF();
36 HISTOGRAM_CUSTOM_COUNTS("Renderer4.AccelContentPaintDurationMS", (paintEnd - paintStart).InMilliseconds(), 0, 120, 30); 36 HISTOGRAM_CUSTOM_COUNTS("Renderer4.AccelContentPaintDurationMS", (paintEnd - paintStart).InMilliseconds(), 0, 120, 30);
37 HISTOGRAM_CUSTOM_COUNTS("Renderer4.AccelContentPaintMegapixPerSecond", pixel sPerSec / 1000000, 10, 210, 30); 37 HISTOGRAM_CUSTOM_COUNTS("Renderer4.AccelContentPaintMegapixPerSecond", pixel sPerSec / 1000000, 10, 210, 30);
38 } 38 }
39 39
40 scoped_refptr<ContentLayer> ContentLayer::create(ContentLayerClient* client) 40 scoped_refptr<ContentLayer> ContentLayer::create(ContentLayerClient* client)
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 } 100 }
101 101
102 void ContentLayer::setContentsOpaque(bool opaque) 102 void ContentLayer::setContentsOpaque(bool opaque)
103 { 103 {
104 Layer::setContentsOpaque(opaque); 104 Layer::setContentsOpaque(opaque);
105 if (m_updater) 105 if (m_updater)
106 m_updater->setOpaque(opaque); 106 m_updater->setOpaque(opaque);
107 } 107 }
108 108
109 } 109 }
OLDNEW
« no previous file with comments | « cc/content_layer.h ('k') | cc/content_layer_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698