| 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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 canvas->save(); | 250 canvas->save(); |
| 251 canvas->translate(SkFloatToScalar(-layer_rect_.x()), | 251 canvas->translate(SkFloatToScalar(-layer_rect_.x()), |
| 252 SkFloatToScalar(-layer_rect_.y())); | 252 SkFloatToScalar(-layer_rect_.y())); |
| 253 | 253 |
| 254 SkRect layer_skrect = SkRect::MakeXYWH(layer_rect_.x(), | 254 SkRect layer_skrect = SkRect::MakeXYWH(layer_rect_.x(), |
| 255 layer_rect_.y(), | 255 layer_rect_.y(), |
| 256 layer_rect_.width(), | 256 layer_rect_.width(), |
| 257 layer_rect_.height()); | 257 layer_rect_.height()); |
| 258 canvas->clipRect(layer_skrect); | 258 canvas->clipRect(layer_skrect); |
| 259 | 259 |
| 260 gfx::RectF opaque_layer_rect; | 260 painter->PaintContents(canvas.get(), layer_rect_, graphics_context_status); |
| 261 painter->PaintContents( | |
| 262 canvas.get(), layer_rect_, &opaque_layer_rect, graphics_context_status); | |
| 263 | 261 |
| 264 canvas->restore(); | 262 canvas->restore(); |
| 265 picture_ = skia::AdoptRef(recorder.endRecording()); | 263 picture_ = skia::AdoptRef(recorder.endRecording()); |
| 266 DCHECK(picture_); | 264 DCHECK(picture_); |
| 267 | 265 |
| 268 if (recording) { | 266 if (recording) { |
| 269 // SkRecording requires it's the only one holding onto canvas before we | 267 // SkRecording requires it's the only one holding onto canvas before we |
| 270 // may call releasePlayback(). (This helps enforce thread-safety.) | 268 // may call releasePlayback(). (This helps enforce thread-safety.) |
| 271 canvas.clear(); | 269 canvas.clear(); |
| 272 playback_.reset(recording->releasePlayback()); | 270 playback_.reset(recording->releasePlayback()); |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 scoped_refptr<base::debug::TracedValue> record_data = | 541 scoped_refptr<base::debug::TracedValue> record_data = |
| 544 new base::debug::TracedValue(); | 542 new base::debug::TracedValue(); |
| 545 TracedValue::SetIDRef(this, record_data.get(), "picture_id"); | 543 TracedValue::SetIDRef(this, record_data.get(), "picture_id"); |
| 546 record_data->BeginArray("layer_rect"); | 544 record_data->BeginArray("layer_rect"); |
| 547 MathUtil::AddToTracedValue(layer_rect_, record_data.get()); | 545 MathUtil::AddToTracedValue(layer_rect_, record_data.get()); |
| 548 record_data->EndArray(); | 546 record_data->EndArray(); |
| 549 return record_data; | 547 return record_data; |
| 550 } | 548 } |
| 551 | 549 |
| 552 } // namespace cc | 550 } // namespace cc |
| OLD | NEW |