| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <limits> | 6 #include <limits> |
| 7 | 7 |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "cc/base/region.h" | 9 #include "cc/base/region.h" |
| 10 #include "cc/debug/debug_colors.h" | 10 #include "cc/debug/debug_colors.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 RenderingStatsInstrumentation* stats_instrumentation) { | 91 RenderingStatsInstrumentation* stats_instrumentation) { |
| 92 RasterCommon( | 92 RasterCommon( |
| 93 canvas, canvas, canvas_rect, contents_scale, stats_instrumentation, true); | 93 canvas, canvas, canvas_rect, contents_scale, stats_instrumentation, true); |
| 94 } | 94 } |
| 95 | 95 |
| 96 void PicturePileImpl::RasterToBitmap( | 96 void PicturePileImpl::RasterToBitmap( |
| 97 SkCanvas* canvas, | 97 SkCanvas* canvas, |
| 98 const gfx::Rect& canvas_rect, | 98 const gfx::Rect& canvas_rect, |
| 99 float contents_scale, | 99 float contents_scale, |
| 100 RenderingStatsInstrumentation* rendering_stats_instrumentation) { | 100 RenderingStatsInstrumentation* rendering_stats_instrumentation) { |
| 101 canvas->discard(); |
| 101 if (clear_canvas_with_debug_color_) { | 102 if (clear_canvas_with_debug_color_) { |
| 102 // Any non-painted areas in the content bounds will be left in this color. | 103 // Any non-painted areas in the content bounds will be left in this color. |
| 103 canvas->clear(DebugColors::NonPaintedFillColor()); | 104 canvas->clear(DebugColors::NonPaintedFillColor()); |
| 104 } | 105 } |
| 105 | 106 |
| 106 // If this picture has opaque contents, it is guaranteeing that it will | 107 // If this picture has opaque contents, it is guaranteeing that it will |
| 107 // draw an opaque rect the size of the layer. If it is not, then we must | 108 // draw an opaque rect the size of the layer. If it is not, then we must |
| 108 // clear this canvas ourselves. | 109 // clear this canvas ourselves. |
| 109 if (contents_opaque_ || contents_fill_bounds_completely_) { | 110 if (contents_opaque_ || contents_fill_bounds_completely_) { |
| 110 // Even if completely covered, for rasterizations that touch the edge of the | 111 // Even if completely covered, for rasterizations that touch the edge of the |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 ++it) { | 453 ++it) { |
| 453 Picture* picture = it->second.GetPicture(); | 454 Picture* picture = it->second.GetPicture(); |
| 454 if (picture && (processed_pictures.count(picture) == 0)) { | 455 if (picture && (processed_pictures.count(picture) == 0)) { |
| 455 picture->EmitTraceSnapshot(); | 456 picture->EmitTraceSnapshot(); |
| 456 processed_pictures.insert(picture); | 457 processed_pictures.insert(picture); |
| 457 } | 458 } |
| 458 } | 459 } |
| 459 } | 460 } |
| 460 | 461 |
| 461 } // namespace cc | 462 } // namespace cc |
| OLD | NEW |