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 "cc/resources/picture.h" | 5 #include "cc/resources/picture.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 recording_mode); | 208 recording_mode); |
209 | 209 |
210 DCHECK(!picture_); | 210 DCHECK(!picture_); |
211 DCHECK(!tile_grid_info.fTileInterval.isEmpty()); | 211 DCHECK(!tile_grid_info.fTileInterval.isEmpty()); |
212 | 212 |
213 SkTileGridFactory factory(tile_grid_info); | 213 SkTileGridFactory factory(tile_grid_info); |
214 SkPictureRecorder recorder; | 214 SkPictureRecorder recorder; |
215 | 215 |
216 skia::RefPtr<SkCanvas> canvas; | 216 skia::RefPtr<SkCanvas> canvas; |
217 canvas = skia::SharePtr(recorder.beginRecording( | 217 canvas = skia::SharePtr(recorder.beginRecording( |
218 layer_rect_.width(), layer_rect_.height(), &factory)); | 218 layer_rect_.width(), layer_rect_.height(), &factory, |
| 219 SkPictureRecorder::kComputeSaveLayerInfo_RecordFlag)); |
219 | 220 |
220 ContentLayerClient::GraphicsContextStatus graphics_context_status = | 221 ContentLayerClient::GraphicsContextStatus graphics_context_status = |
221 ContentLayerClient::GRAPHICS_CONTEXT_ENABLED; | 222 ContentLayerClient::GRAPHICS_CONTEXT_ENABLED; |
222 | 223 |
223 switch (recording_mode) { | 224 switch (recording_mode) { |
224 case RECORD_NORMALLY: | 225 case RECORD_NORMALLY: |
225 // Already setup for normal recording. | 226 // Already setup for normal recording. |
226 break; | 227 break; |
227 case RECORD_WITH_SK_NULL_CANVAS: | 228 case RECORD_WITH_SK_NULL_CANVAS: |
228 canvas = skia::AdoptRef(SkCreateNullCanvas()); | 229 canvas = skia::AdoptRef(SkCreateNullCanvas()); |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 scoped_refptr<base::debug::TracedValue> record_data = | 512 scoped_refptr<base::debug::TracedValue> record_data = |
512 new base::debug::TracedValue(); | 513 new base::debug::TracedValue(); |
513 TracedValue::SetIDRef(this, record_data.get(), "picture_id"); | 514 TracedValue::SetIDRef(this, record_data.get(), "picture_id"); |
514 record_data->BeginArray("layer_rect"); | 515 record_data->BeginArray("layer_rect"); |
515 MathUtil::AddToTracedValue(layer_rect_, record_data.get()); | 516 MathUtil::AddToTracedValue(layer_rect_, record_data.get()); |
516 record_data->EndArray(); | 517 record_data->EndArray(); |
517 return record_data; | 518 return record_data; |
518 } | 519 } |
519 | 520 |
520 } // namespace cc | 521 } // namespace cc |
OLD | NEW |