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 <algorithm> | 5 #include <algorithm> |
6 #include <limits> | 6 #include <limits> |
7 | 7 |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "cc/base/region.h" | 9 #include "cc/base/region.h" |
10 #include "cc/debug/debug_colors.h" | 10 #include "cc/debug/debug_colors.h" |
11 #include "cc/resources/picture_pile_impl.h" | 11 #include "cc/resources/picture_pile_impl.h" |
| 12 #include "cc/resources/worker_pool.h" |
12 #include "skia/ext/analysis_canvas.h" | 13 #include "skia/ext/analysis_canvas.h" |
13 #include "third_party/skia/include/core/SkCanvas.h" | 14 #include "third_party/skia/include/core/SkCanvas.h" |
14 #include "third_party/skia/include/core/SkSize.h" | 15 #include "third_party/skia/include/core/SkSize.h" |
15 #include "ui/gfx/rect_conversions.h" | 16 #include "ui/gfx/rect_conversions.h" |
16 #include "ui/gfx/size_conversions.h" | 17 #include "ui/gfx/size_conversions.h" |
17 #include "ui/gfx/skia_util.h" | 18 #include "ui/gfx/skia_util.h" |
18 | 19 |
19 namespace cc { | 20 namespace cc { |
20 | 21 |
21 PicturePileImpl::ClonesForDrawing::ClonesForDrawing( | 22 PicturePileImpl::ClonesForDrawing::ClonesForDrawing( |
(...skipping 21 matching lines...) Expand all Loading... |
43 const PicturePileImpl* other, unsigned thread_index) { | 44 const PicturePileImpl* other, unsigned thread_index) { |
44 return make_scoped_refptr(new PicturePileImpl(other, thread_index)); | 45 return make_scoped_refptr(new PicturePileImpl(other, thread_index)); |
45 } | 46 } |
46 | 47 |
47 PicturePileImpl::PicturePileImpl() | 48 PicturePileImpl::PicturePileImpl() |
48 : clones_for_drawing_(ClonesForDrawing(this, 0)) { | 49 : clones_for_drawing_(ClonesForDrawing(this, 0)) { |
49 } | 50 } |
50 | 51 |
51 PicturePileImpl::PicturePileImpl(const PicturePileBase* other) | 52 PicturePileImpl::PicturePileImpl(const PicturePileBase* other) |
52 : PicturePileBase(other), | 53 : PicturePileBase(other), |
53 clones_for_drawing_(ClonesForDrawing(this, num_raster_threads())) { | 54 clones_for_drawing_(ClonesForDrawing( |
| 55 this, WorkerPool::GetNumRasterThreads())) { |
54 } | 56 } |
55 | 57 |
56 PicturePileImpl::PicturePileImpl( | 58 PicturePileImpl::PicturePileImpl( |
57 const PicturePileImpl* other, unsigned thread_index) | 59 const PicturePileImpl* other, unsigned thread_index) |
58 : PicturePileBase(other, thread_index), | 60 : PicturePileBase(other, thread_index), |
59 clones_for_drawing_(ClonesForDrawing(this, 0)) { | 61 clones_for_drawing_(ClonesForDrawing(this, 0)) { |
60 } | 62 } |
61 | 63 |
62 PicturePileImpl::~PicturePileImpl() { | 64 PicturePileImpl::~PicturePileImpl() { |
63 } | 65 } |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 ++it) { | 407 ++it) { |
406 Picture* picture = it->second.GetPicture(); | 408 Picture* picture = it->second.GetPicture(); |
407 if (picture && (processed_pictures.count(picture) == 0)) { | 409 if (picture && (processed_pictures.count(picture) == 0)) { |
408 picture->EmitTraceSnapshot(); | 410 picture->EmitTraceSnapshot(); |
409 processed_pictures.insert(picture); | 411 processed_pictures.insert(picture); |
410 } | 412 } |
411 } | 413 } |
412 } | 414 } |
413 | 415 |
414 } // namespace cc | 416 } // namespace cc |
OLD | NEW |