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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 "cc", | 296 "cc", |
297 "Picture::Raster", | 297 "Picture::Raster", |
298 "data", | 298 "data", |
299 AsTraceableRasterData(contents_scale)); | 299 AsTraceableRasterData(contents_scale)); |
300 | 300 |
301 DCHECK(picture_); | 301 DCHECK(picture_); |
302 | 302 |
303 canvas->save(); | 303 canvas->save(); |
304 | 304 |
305 for (Region::Iterator it(negated_content_region); it.has_rect(); it.next()) | 305 for (Region::Iterator it(negated_content_region); it.has_rect(); it.next()) |
306 canvas->clipRect(gfx::RectToSkRect(it.rect()), SkRegion::kDifference_Op); | 306 canvas->clipRect(gfx::RectToSkRect(it.rect()), kDifference_SkClipOp); |
307 | 307 |
308 canvas->scale(contents_scale, contents_scale); | 308 canvas->scale(contents_scale, contents_scale); |
309 canvas->translate(layer_rect_.x(), layer_rect_.y()); | 309 canvas->translate(layer_rect_.x(), layer_rect_.y()); |
310 if (callback) { | 310 if (callback) { |
311 // If we have a callback, we need to call |draw()|, |drawPicture()| doesn't | 311 // If we have a callback, we need to call |draw()|, |drawPicture()| doesn't |
312 // take a callback. This is used by |AnalysisCanvas| to early out. | 312 // take a callback. This is used by |AnalysisCanvas| to early out. |
313 picture_->playback(canvas, callback); | 313 picture_->playback(canvas, callback); |
314 } else { | 314 } else { |
315 // Prefer to call |drawPicture()| on the canvas since it could place the | 315 // Prefer to call |drawPicture()| on the canvas since it could place the |
316 // entire picture on the canvas instead of parsing the skia operations. | 316 // entire picture on the canvas instead of parsing the skia operations. |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 scoped_refptr<base::debug::TracedValue> record_data = | 477 scoped_refptr<base::debug::TracedValue> record_data = |
478 new base::debug::TracedValue(); | 478 new base::debug::TracedValue(); |
479 TracedValue::SetIDRef(this, record_data.get(), "picture_id"); | 479 TracedValue::SetIDRef(this, record_data.get(), "picture_id"); |
480 record_data->BeginArray("layer_rect"); | 480 record_data->BeginArray("layer_rect"); |
481 MathUtil::AddToTracedValue(layer_rect_, record_data.get()); | 481 MathUtil::AddToTracedValue(layer_rect_, record_data.get()); |
482 record_data->EndArray(); | 482 record_data->EndArray(); |
483 return record_data; | 483 return record_data; |
484 } | 484 } |
485 | 485 |
486 } // namespace cc | 486 } // namespace cc |
OLD | NEW |