| 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/resources/display_list_recording_source.h" | 5 #include "cc/resources/display_list_recording_source.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "cc/base/region.h" | 9 #include "cc/base/region.h" |
| 10 #include "cc/layers/content_layer_client.h" | 10 #include "cc/layers/content_layer_client.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 if (!updated && !invalidation->Intersects(recorded_viewport_)) | 80 if (!updated && !invalidation->Intersects(recorded_viewport_)) |
| 81 return false; | 81 return false; |
| 82 | 82 |
| 83 // TODO(ajuma): Does repeating this way really makes sense with display lists? | 83 // TODO(ajuma): Does repeating this way really makes sense with display lists? |
| 84 // With Blink caching recordings, repeated calls will not cause re-recording. | 84 // With Blink caching recordings, repeated calls will not cause re-recording. |
| 85 int repeat_count = std::max(1, slow_down_raster_scale_factor_for_debug_); | 85 int repeat_count = std::max(1, slow_down_raster_scale_factor_for_debug_); |
| 86 for (int i = 0; i < repeat_count; ++i) { | 86 for (int i = 0; i < repeat_count; ++i) { |
| 87 display_list_ = painter->PaintContentsToDisplayList( | 87 display_list_ = painter->PaintContentsToDisplayList( |
| 88 recorded_viewport_, ContentLayerClient::GRAPHICS_CONTEXT_ENABLED); | 88 recorded_viewport_, ContentLayerClient::GRAPHICS_CONTEXT_ENABLED); |
| 89 } | 89 } |
| 90 display_list_->set_layer_rect(recorded_viewport_); |
| 90 is_suitable_for_gpu_rasterization_ = | 91 is_suitable_for_gpu_rasterization_ = |
| 91 display_list_->IsSuitableForGpuRasterization(); | 92 display_list_->IsSuitableForGpuRasterization(); |
| 92 | 93 |
| 93 DetermineIfSolidColor(); | 94 DetermineIfSolidColor(); |
| 94 display_list_->EmitTraceSnapshot(); | 95 display_list_->EmitTraceSnapshot(); |
| 95 return true; | 96 return true; |
| 96 } | 97 } |
| 97 | 98 |
| 98 gfx::Size DisplayListRecordingSource::GetSize() const { | 99 gfx::Size DisplayListRecordingSource::GetSize() const { |
| 99 return size_; | 100 return size_; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 is_solid_color_ = canvas.GetColorIfSolid(&solid_color_); | 149 is_solid_color_ = canvas.GetColorIfSolid(&solid_color_); |
| 149 } | 150 } |
| 150 | 151 |
| 151 void DisplayListRecordingSource::Clear() { | 152 void DisplayListRecordingSource::Clear() { |
| 152 recorded_viewport_ = gfx::Rect(); | 153 recorded_viewport_ = gfx::Rect(); |
| 153 display_list_ = NULL; | 154 display_list_ = NULL; |
| 154 is_solid_color_ = false; | 155 is_solid_color_ = false; |
| 155 } | 156 } |
| 156 | 157 |
| 157 } // namespace cc | 158 } // namespace cc |
| OLD | NEW |