OLD | NEW |
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/content_layer_client.h" | 6 #include "cc/content_layer_client.h" |
7 #include "cc/picture.h" | 7 #include "cc/picture.h" |
8 #include "cc/rendering_stats.h" | 8 #include "cc/rendering_stats.h" |
9 #include "third_party/skia/include/core/SkCanvas.h" | 9 #include "third_party/skia/include/core/SkCanvas.h" |
10 #include "third_party/skia/include/core/SkData.h" | 10 #include "third_party/skia/include/core/SkData.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 SkRect layer_skrect = SkRect::MakeXYWH(layer_rect_.x(), | 72 SkRect layer_skrect = SkRect::MakeXYWH(layer_rect_.x(), |
73 layer_rect_.y(), | 73 layer_rect_.y(), |
74 layer_rect_.width(), | 74 layer_rect_.width(), |
75 layer_rect_.height()); | 75 layer_rect_.height()); |
76 canvas->clipRect(layer_skrect); | 76 canvas->clipRect(layer_skrect); |
77 canvas->drawRect(layer_skrect, paint); | 77 canvas->drawRect(layer_skrect, paint); |
78 | 78 |
79 gfx::RectF opaque_layer_rect; | 79 gfx::RectF opaque_layer_rect; |
80 base::TimeTicks beginPaintTime = base::TimeTicks::Now(); | 80 base::TimeTicks beginPaintTime = base::TimeTicks::Now(); |
81 painter->paintContents(canvas, layer_rect_, opaque_layer_rect); | 81 painter->paintContents(canvas, layer_rect_, opaque_layer_rect); |
82 double delta = (base::TimeTicks::Now() - beginPaintTime).InSecondsF(); | 82 stats.totalPaintTime += base::TimeTicks::Now() - beginPaintTime; |
83 stats.totalPaintTimeInSeconds += delta; | |
84 stats.totalPixelsPainted += layer_rect_.width() * | 83 stats.totalPixelsPainted += layer_rect_.width() * |
85 layer_rect_.height(); | 84 layer_rect_.height(); |
86 | 85 |
87 canvas->restore(); | 86 canvas->restore(); |
88 picture_->endRecording(); | 87 picture_->endRecording(); |
89 | 88 |
90 opaque_rect_ = gfx::ToEnclosedRect(opaque_layer_rect); | 89 opaque_rect_ = gfx::ToEnclosedRect(opaque_layer_rect); |
91 } | 90 } |
92 | 91 |
93 void Picture::Raster( | 92 void Picture::Raster( |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 if (*refs && (*refs)->getURI() && !strncmp( | 127 if (*refs && (*refs)->getURI() && !strncmp( |
129 (*refs)->getURI(), labelLazyDecoded, 4)) { | 128 (*refs)->getURI(), labelLazyDecoded, 4)) { |
130 result.push_back(static_cast<skia::LazyPixelRef*>(*refs)); | 129 result.push_back(static_cast<skia::LazyPixelRef*>(*refs)); |
131 } | 130 } |
132 refs++; | 131 refs++; |
133 } | 132 } |
134 pixel_refs->unref(); | 133 pixel_refs->unref(); |
135 } | 134 } |
136 | 135 |
137 } // namespace cc | 136 } // namespace cc |
OLD | NEW |