| 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 <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/base64.h" | 10 #include "base/base64.h" |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 | 211 |
| 212 canvas->save(); | 212 canvas->save(); |
| 213 canvas->translate(SkFloatToScalar(-layer_rect_.x()), | 213 canvas->translate(SkFloatToScalar(-layer_rect_.x()), |
| 214 SkFloatToScalar(-layer_rect_.y())); | 214 SkFloatToScalar(-layer_rect_.y())); |
| 215 | 215 |
| 216 canvas->clipRect(gfx::RectToSkRect(layer_rect_)); | 216 canvas->clipRect(gfx::RectToSkRect(layer_rect_)); |
| 217 | 217 |
| 218 painter->PaintContents(canvas.get(), layer_rect_, painting_control); | 218 painter->PaintContents(canvas.get(), layer_rect_, painting_control); |
| 219 | 219 |
| 220 canvas->restore(); | 220 canvas->restore(); |
| 221 picture_ = skia::AdoptRef(recorder.endRecording()); | 221 picture_ = skia::AdoptRef(recorder.endRecordingAsPicture()); |
| 222 DCHECK(picture_); | 222 DCHECK(picture_); |
| 223 | 223 |
| 224 EmitTraceSnapshot(); | 224 EmitTraceSnapshot(); |
| 225 } | 225 } |
| 226 | 226 |
| 227 void Picture::GatherPixelRefs() { | 227 void Picture::GatherPixelRefs() { |
| 228 TRACE_EVENT2("cc", "Picture::GatherPixelRefs", | 228 TRACE_EVENT2("cc", "Picture::GatherPixelRefs", |
| 229 "width", layer_rect_.width(), | 229 "width", layer_rect_.width(), |
| 230 "height", layer_rect_.height()); | 230 "height", layer_rect_.height()); |
| 231 | 231 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 scoped_refptr<base::trace_event::ConvertableToTraceFormat> | 329 scoped_refptr<base::trace_event::ConvertableToTraceFormat> |
| 330 Picture::AsTraceableRecordData() const { | 330 Picture::AsTraceableRecordData() const { |
| 331 scoped_refptr<base::trace_event::TracedValue> record_data = | 331 scoped_refptr<base::trace_event::TracedValue> record_data = |
| 332 new base::trace_event::TracedValue(); | 332 new base::trace_event::TracedValue(); |
| 333 TracedValue::SetIDRef(this, record_data.get(), "picture_id"); | 333 TracedValue::SetIDRef(this, record_data.get(), "picture_id"); |
| 334 MathUtil::AddToTracedValue("layer_rect", layer_rect_, record_data.get()); | 334 MathUtil::AddToTracedValue("layer_rect", layer_rect_, record_data.get()); |
| 335 return record_data; | 335 return record_data; |
| 336 } | 336 } |
| 337 | 337 |
| 338 } // namespace cc | 338 } // namespace cc |
| OLD | NEW |