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

Side by Side Diff: cc/picture_pile_impl.cc

Issue 11896002: [cc] Use base::TimeTicks in RenderStats (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: renderwidget too Created 7 years, 11 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/picture.cc ('k') | cc/raster_worker_pool.cc » ('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 "base/debug/trace_event.h" 5 #include "base/debug/trace_event.h"
6 #include "cc/picture_pile_impl.h" 6 #include "cc/picture_pile_impl.h"
7 #include "cc/rendering_stats.h" 7 #include "cc/rendering_stats.h"
8 #include "third_party/skia/include/core/SkCanvas.h" 8 #include "third_party/skia/include/core/SkCanvas.h"
9 #include "third_party/skia/include/core/SkSize.h" 9 #include "third_party/skia/include/core/SkSize.h"
10 #include "ui/gfx/rect_conversions.h" 10 #include "ui/gfx/rect_conversions.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 81
82 // Don't allow pictures underneath to draw where this picture did. 82 // Don't allow pictures underneath to draw where this picture did.
83 canvas->clipRect(gfx::RectToSkRect(content_clip), SkRegion::kDifference_Op); 83 canvas->clipRect(gfx::RectToSkRect(content_clip), SkRegion::kDifference_Op);
84 unclipped.Subtract(content_clip); 84 unclipped.Subtract(content_clip);
85 85
86 stats->totalPixelsRasterized += 86 stats->totalPixelsRasterized +=
87 content_clip.width() * content_clip.height(); 87 content_clip.width() * content_clip.height();
88 } 88 }
89 canvas->restore(); 89 canvas->restore();
90 90
91 stats->totalRasterizeTimeInSeconds += (base::TimeTicks::Now() - 91 stats->totalRasterizeTime += base::TimeTicks::Now() - rasterizeBeginTime;
92 rasterizeBeginTime).InSecondsF();
93 } 92 }
94 93
95 void PicturePileImpl::GatherPixelRefs( 94 void PicturePileImpl::GatherPixelRefs(
96 const gfx::Rect& rect, std::list<skia::LazyPixelRef*>& pixel_refs) { 95 const gfx::Rect& rect, std::list<skia::LazyPixelRef*>& pixel_refs) {
97 std::list<skia::LazyPixelRef*> result; 96 std::list<skia::LazyPixelRef*> result;
98 for (PicturePile::Pile::const_iterator i = pile_.begin(); 97 for (PicturePile::Pile::const_iterator i = pile_.begin();
99 i != pile_.end(); ++i) { 98 i != pile_.end(); ++i) {
100 (*i)->GatherPixelRefs(rect, result); 99 (*i)->GatherPixelRefs(rect, result);
101 pixel_refs.splice(pixel_refs.end(), result); 100 pixel_refs.splice(pixel_refs.end(), result);
102 } 101 }
(...skipping 18 matching lines...) Expand all
121 SkPicture::kUsePathBoundsForClip_RecordingFlag); 120 SkPicture::kUsePathBoundsForClip_RecordingFlag);
122 121
123 RenderingStats stats; 122 RenderingStats stats;
124 Raster(canvas, layer_rect, 1.0, &stats); 123 Raster(canvas, layer_rect, 1.0, &stats);
125 picture->endRecording(); 124 picture->endRecording();
126 125
127 return picture; 126 return picture;
128 } 127 }
129 128
130 } // namespace cc 129 } // namespace cc
OLDNEW
« no previous file with comments | « cc/picture.cc ('k') | cc/raster_worker_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698