| OLD | NEW |
| 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/content_layer_updater.h" | 5 #include "cc/resources/content_layer_updater.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/time.h" | 8 #include "base/time.h" |
| 9 #include "cc/debug/rendering_stats.h" | 9 #include "cc/debug/rendering_stats.h" |
| 10 #include "cc/resources/layer_painter.h" | 10 #include "cc/resources/layer_painter.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 : painter_(painter.Pass()) {} | 21 : painter_(painter.Pass()) {} |
| 22 | 22 |
| 23 ContentLayerUpdater::~ContentLayerUpdater() {} | 23 ContentLayerUpdater::~ContentLayerUpdater() {} |
| 24 | 24 |
| 25 void ContentLayerUpdater::PaintContents(SkCanvas* canvas, | 25 void ContentLayerUpdater::PaintContents(SkCanvas* canvas, |
| 26 gfx::Rect content_rect, | 26 gfx::Rect content_rect, |
| 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 RenderingStats* stats) { | 30 RenderingStats* stats) { |
| 31 TRACE_EVENT0("cc", "ContentLayerUpdater::paintContents"); | 31 TRACE_EVENT0("cc", "ContentLayerUpdater::PaintContents"); |
| 32 canvas->save(); | 32 canvas->save(); |
| 33 canvas->translate(SkFloatToScalar(-content_rect.x()), | 33 canvas->translate(SkFloatToScalar(-content_rect.x()), |
| 34 SkFloatToScalar(-content_rect.y())); | 34 SkFloatToScalar(-content_rect.y())); |
| 35 | 35 |
| 36 gfx::Rect layer_rect = content_rect; | 36 gfx::Rect layer_rect = content_rect; |
| 37 | 37 |
| 38 if (contents_width_scale != 1.f || contents_height_scale != 1.f) { | 38 if (contents_width_scale != 1.f || contents_height_scale != 1.f) { |
| 39 canvas->scale(SkFloatToScalar(contents_width_scale), | 39 canvas->scale(SkFloatToScalar(contents_width_scale), |
| 40 SkFloatToScalar(contents_height_scale)); | 40 SkFloatToScalar(contents_height_scale)); |
| 41 | 41 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 64 canvas->restore(); | 64 canvas->restore(); |
| 65 | 65 |
| 66 gfx::RectF opaque_content_rect = gfx::ScaleRect( | 66 gfx::RectF opaque_content_rect = gfx::ScaleRect( |
| 67 opaque_layer_rect, contents_width_scale, contents_height_scale); | 67 opaque_layer_rect, contents_width_scale, contents_height_scale); |
| 68 *resulting_opaque_rect = gfx::ToEnclosedRect(opaque_content_rect); | 68 *resulting_opaque_rect = gfx::ToEnclosedRect(opaque_content_rect); |
| 69 | 69 |
| 70 content_rect_ = content_rect; | 70 content_rect_ = content_rect; |
| 71 } | 71 } |
| 72 | 72 |
| 73 } // namespace cc | 73 } // namespace cc |
| OLD | NEW |