Chromium Code Reviews| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 90 RenderingStatsInstrumentation* stats_instrumentation) { | 90 RenderingStatsInstrumentation* stats_instrumentation) { |
| 91 RasterCommon( | 91 RasterCommon( |
| 92 canvas, canvas, canvas_rect, contents_scale, stats_instrumentation, true); | 92 canvas, canvas, canvas_rect, contents_scale, stats_instrumentation, true); |
| 93 } | 93 } |
| 94 | 94 |
| 95 void PicturePileImpl::RasterToBitmap( | 95 void PicturePileImpl::RasterToBitmap( |
| 96 SkCanvas* canvas, | 96 SkCanvas* canvas, |
| 97 const gfx::Rect& canvas_rect, | 97 const gfx::Rect& canvas_rect, |
| 98 float contents_scale, | 98 float contents_scale, |
| 99 RenderingStatsInstrumentation* rendering_stats_instrumentation) { | 99 RenderingStatsInstrumentation* rendering_stats_instrumentation) { |
| 100 DCHECK(canvas->getBaseLayerSize().equals(canvas_rect.width(), | |
| 101 canvas_rect.height())); | |
|
reveman
2014/05/09 00:56:29
Should we really require this? In that case, shoul
alokp
2014/05/09 20:13:04
We do not require it as far as the API is concerne
reveman
2014/05/10 00:34:52
I think I prefer if you didn't add this DCHECK. Wi
alokp
2014/05/12 18:45:33
OK. Removed DCHECK. I think we should make it clea
reveman
2014/05/12 18:51:38
Yea, that wouldn't hurt. Feel free to add a commen
| |
| 102 canvas->discard(); | |
| 100 if (clear_canvas_with_debug_color_) { | 103 if (clear_canvas_with_debug_color_) { |
| 101 // Any non-painted areas will be left in this color. | 104 // Any non-painted areas will be left in this color. |
| 102 canvas->clear(DebugColors::NonPaintedFillColor()); | 105 canvas->clear(DebugColors::NonPaintedFillColor()); |
| 103 } | 106 } |
| 104 | 107 |
| 105 // If this picture has opaque contents, it is guaranteeing that it will | 108 // If this picture has opaque contents, it is guaranteeing that it will |
| 106 // draw an opaque rect the size of the layer. If it is not, then we must | 109 // draw an opaque rect the size of the layer. If it is not, then we must |
| 107 // clear this canvas ourselves. | 110 // clear this canvas ourselves. |
| 108 if (contents_opaque_ || contents_fill_bounds_completely_) { | 111 if (contents_opaque_ || contents_fill_bounds_completely_) { |
| 109 // Even if completely covered, for rasterizations that touch the edge of the | 112 // Even if completely covered, for rasterizations that touch the edge of the |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 443 ++it) { | 446 ++it) { |
| 444 Picture* picture = it->second.GetPicture(); | 447 Picture* picture = it->second.GetPicture(); |
| 445 if (picture && (processed_pictures.count(picture) == 0)) { | 448 if (picture && (processed_pictures.count(picture) == 0)) { |
| 446 picture->EmitTraceSnapshot(); | 449 picture->EmitTraceSnapshot(); |
| 447 processed_pictures.insert(picture); | 450 processed_pictures.insert(picture); |
| 448 } | 451 } |
| 449 } | 452 } |
| 450 } | 453 } |
| 451 | 454 |
| 452 } // namespace cc | 455 } // namespace cc |
| OLD | NEW |