| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/playback/display_list_recording_source.h" | 5 #include "cc/playback/display_list_recording_source.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/numerics/safe_math.h" | 9 #include "base/numerics/safe_math.h" |
| 10 #include "cc/base/histograms.h" | 10 #include "cc/base/histograms.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 case RECORD_WITH_CONSTRUCTION_DISABLED: | 107 case RECORD_WITH_CONSTRUCTION_DISABLED: |
| 108 painting_control = ContentLayerClient::DISPLAY_LIST_CONSTRUCTION_DISABLED; | 108 painting_control = ContentLayerClient::DISPLAY_LIST_CONSTRUCTION_DISABLED; |
| 109 break; | 109 break; |
| 110 case RECORD_WITH_SK_NULL_CANVAS: | 110 case RECORD_WITH_SK_NULL_CANVAS: |
| 111 case RECORDING_MODE_COUNT: | 111 case RECORDING_MODE_COUNT: |
| 112 NOTREACHED(); | 112 NOTREACHED(); |
| 113 } | 113 } |
| 114 | 114 |
| 115 // TODO(vmpstr): Add a slow_down_recording_scale_factor_for_debug_ to be able | 115 // TODO(vmpstr): Add a slow_down_recording_scale_factor_for_debug_ to be able |
| 116 // to slow down recording. | 116 // to slow down recording. |
| 117 display_list_ = | 117 display_list_ = painter->PaintContentsToDisplayList(painting_control); |
| 118 painter->PaintContentsToDisplayList(recorded_viewport_, painting_control); | |
| 119 painter_reported_memory_usage_ = painter->GetApproximateUnsharedMemoryUsage(); | 118 painter_reported_memory_usage_ = painter->GetApproximateUnsharedMemoryUsage(); |
| 120 | 119 |
| 121 DetermineIfSolidColor(); | 120 DetermineIfSolidColor(); |
| 122 display_list_->EmitTraceSnapshot(); | 121 display_list_->EmitTraceSnapshot(); |
| 123 if (generate_discardable_images_metadata_) | 122 if (generate_discardable_images_metadata_) |
| 124 display_list_->GenerateDiscardableImagesMetadata(); | 123 display_list_->GenerateDiscardableImagesMetadata(); |
| 125 | 124 |
| 126 return true; | 125 return true; |
| 127 } | 126 } |
| 128 | 127 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 } | 181 } |
| 183 | 182 |
| 184 void DisplayListRecordingSource::Clear() { | 183 void DisplayListRecordingSource::Clear() { |
| 185 recorded_viewport_ = gfx::Rect(); | 184 recorded_viewport_ = gfx::Rect(); |
| 186 display_list_ = nullptr; | 185 display_list_ = nullptr; |
| 187 painter_reported_memory_usage_ = 0; | 186 painter_reported_memory_usage_ = 0; |
| 188 is_solid_color_ = false; | 187 is_solid_color_ = false; |
| 189 } | 188 } |
| 190 | 189 |
| 191 } // namespace cc | 190 } // namespace cc |
| OLD | NEW |