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 "base/debug/trace_event.h" | 5 #include "base/debug/trace_event.h" |
6 #include "cc/debug/rendering_stats.h" | 6 #include "cc/debug/rendering_stats.h" |
7 #include "cc/layers/content_layer_client.h" | 7 #include "cc/layers/content_layer_client.h" |
8 #include "cc/resources/picture.h" | 8 #include "cc/resources/picture.h" |
9 #include "skia/ext/analysis_canvas.h" | 9 #include "skia/ext/analysis_canvas.h" |
10 #include "third_party/skia/include/core/SkCanvas.h" | 10 #include "third_party/skia/include/core/SkCanvas.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 void Picture::Record(ContentLayerClient* painter, | 81 void Picture::Record(ContentLayerClient* painter, |
82 RenderingStats* stats, | 82 RenderingStats* stats, |
83 const SkTileGridPicture::TileGridInfo& tile_grid_info) { | 83 const SkTileGridPicture::TileGridInfo& tile_grid_info) { |
84 TRACE_EVENT2("cc", "Picture::Record", | 84 TRACE_EVENT2("cc", "Picture::Record", |
85 "width", layer_rect_.width(), "height", layer_rect_.height()); | 85 "width", layer_rect_.width(), "height", layer_rect_.height()); |
86 | 86 |
87 // Record() should only be called once. | 87 // Record() should only be called once. |
88 DCHECK(!picture_); | 88 DCHECK(!picture_); |
89 DCHECK(!tile_grid_info.fTileInterval.isEmpty()); | 89 DCHECK(!tile_grid_info.fTileInterval.isEmpty()); |
90 picture_ = skia::AdoptRef(new SkTileGridPicture( | 90 // TODO(enne): Turn back on tile grid after |
91 layer_rect_.width(), layer_rect_.height(), tile_grid_info)); | 91 // https://code.google.com/p/skia/issues/detail?id=1209 is fixed. |
| 92 picture_ = skia::AdoptRef(new SkPicture()); |
92 | 93 |
93 SkCanvas* canvas = picture_->beginRecording( | 94 SkCanvas* canvas = picture_->beginRecording( |
94 layer_rect_.width(), | 95 layer_rect_.width(), |
95 layer_rect_.height(), | 96 layer_rect_.height(), |
96 SkPicture::kUsePathBoundsForClip_RecordingFlag | | 97 SkPicture::kUsePathBoundsForClip_RecordingFlag | |
97 SkPicture::kOptimizeForClippedPlayback_RecordingFlag); | 98 SkPicture::kOptimizeForClippedPlayback_RecordingFlag); |
98 | 99 |
99 canvas->save(); | 100 canvas->save(); |
100 canvas->translate(SkFloatToScalar(-layer_rect_.x()), | 101 canvas->translate(SkFloatToScalar(-layer_rect_.x()), |
101 SkFloatToScalar(-layer_rect_.y())); | 102 SkFloatToScalar(-layer_rect_.y())); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 if (*refs && (*refs)->getURI() && !strncmp( | 173 if (*refs && (*refs)->getURI() && !strncmp( |
173 (*refs)->getURI(), kLabelLazyDecoded, 4)) { | 174 (*refs)->getURI(), kLabelLazyDecoded, 4)) { |
174 pixel_ref_list.push_back(static_cast<skia::LazyPixelRef*>(*refs)); | 175 pixel_ref_list.push_back(static_cast<skia::LazyPixelRef*>(*refs)); |
175 } | 176 } |
176 refs++; | 177 refs++; |
177 } | 178 } |
178 pixel_refs->unref(); | 179 pixel_refs->unref(); |
179 } | 180 } |
180 | 181 |
181 } // namespace cc | 182 } // namespace cc |
OLD | NEW |