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

Side by Side Diff: trunk/src/cc/resources/skpicture_content_layer_updater.cc

Issue 100923002: Revert 225751 "BitmapContentLayerUpdater shouldn't reallocate bi..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years 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
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 "cc/resources/skpicture_content_layer_updater.h" 5 #include "cc/resources/skpicture_content_layer_updater.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "cc/debug/rendering_stats_instrumentation.h" 8 #include "cc/debug/rendering_stats_instrumentation.h"
9 #include "cc/resources/layer_painter.h" 9 #include "cc/resources/layer_painter.h"
10 #include "cc/resources/prioritized_resource.h" 10 #include "cc/resources/prioritized_resource.h"
(...skipping 14 matching lines...) Expand all
25 gfx::Rect content_rect, 25 gfx::Rect content_rect,
26 gfx::Size, 26 gfx::Size,
27 float contents_width_scale, 27 float contents_width_scale,
28 float contents_height_scale, 28 float contents_height_scale,
29 gfx::Rect* resulting_opaque_rect) { 29 gfx::Rect* resulting_opaque_rect) {
30 SkCanvas* canvas = 30 SkCanvas* canvas =
31 picture_.beginRecording(content_rect.width(), content_rect.height()); 31 picture_.beginRecording(content_rect.width(), content_rect.height());
32 base::TimeTicks start_time = 32 base::TimeTicks start_time =
33 rendering_stats_instrumentation_->StartRecording(); 33 rendering_stats_instrumentation_->StartRecording();
34 PaintContents(canvas, 34 PaintContents(canvas,
35 content_rect, 35 content_rect.origin(),
36 contents_width_scale, 36 contents_width_scale,
37 contents_height_scale, 37 contents_height_scale,
38 resulting_opaque_rect); 38 resulting_opaque_rect);
39 base::TimeDelta duration = 39 base::TimeDelta duration =
40 rendering_stats_instrumentation_->EndRecording(start_time); 40 rendering_stats_instrumentation_->EndRecording(start_time);
41 rendering_stats_instrumentation_->AddRecord( 41 rendering_stats_instrumentation_->AddRecord(
42 duration, content_rect.width() * content_rect.height()); 42 duration, content_rect.width() * content_rect.height());
43 picture_.endRecording(); 43 picture_.endRecording();
44 } 44 }
45 45
46 void SkPictureContentLayerUpdater::DrawPicture(SkCanvas* canvas) { 46 void SkPictureContentLayerUpdater::DrawPicture(SkCanvas* canvas) {
47 TRACE_EVENT0("cc", "SkPictureContentLayerUpdater::DrawPicture"); 47 TRACE_EVENT0("cc", "SkPictureContentLayerUpdater::DrawPicture");
48 canvas->drawPicture(picture_); 48 canvas->drawPicture(picture_);
49 } 49 }
50 50
51 } // namespace cc 51 } // namespace cc
OLDNEW
« no previous file with comments | « trunk/src/cc/resources/content_layer_updater.cc ('k') | trunk/src/ui/compositor/layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698