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/layers/picture_layer.h" | 5 #include "cc/layers/picture_layer.h" |
6 | 6 |
7 #include "cc/layers/content_layer_client.h" | 7 #include "cc/layers/content_layer_client.h" |
8 #include "cc/layers/picture_layer_impl.h" | 8 #include "cc/layers/picture_layer_impl.h" |
9 #include "cc/trees/layer_tree_impl.h" | 9 #include "cc/trees/layer_tree_impl.h" |
10 #include "third_party/skia/include/core/SkPictureRecorder.h" | 10 #include "third_party/skia/include/core/SkPictureRecorder.h" |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 // picture. For now we just paint a fresh one to get consistent results. | 163 // picture. For now we just paint a fresh one to get consistent results. |
164 if (!DrawsContent()) | 164 if (!DrawsContent()) |
165 return skia::RefPtr<SkPicture>(); | 165 return skia::RefPtr<SkPicture>(); |
166 | 166 |
167 int width = bounds().width(); | 167 int width = bounds().width(); |
168 int height = bounds().height(); | 168 int height = bounds().height(); |
169 gfx::RectF opaque; | 169 gfx::RectF opaque; |
170 | 170 |
171 SkPictureRecorder recorder; | 171 SkPictureRecorder recorder; |
172 SkCanvas* canvas = recorder.beginRecording(width, height, NULL, 0); | 172 SkCanvas* canvas = recorder.beginRecording(width, height, NULL, 0); |
173 client_->PaintContents(canvas, gfx::Rect(width, height), &opaque); | 173 client_->PaintContents(canvas, |
| 174 gfx::Rect(width, height), |
| 175 &opaque, |
| 176 ContentLayerClient::GRAPHICS_CONTEXT_ENABLED); |
174 skia::RefPtr<SkPicture> picture = skia::AdoptRef(recorder.endRecording()); | 177 skia::RefPtr<SkPicture> picture = skia::AdoptRef(recorder.endRecording()); |
175 return picture; | 178 return picture; |
176 } | 179 } |
177 | 180 |
178 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 181 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { |
179 benchmark->RunOnLayer(this); | 182 benchmark->RunOnLayer(this); |
180 } | 183 } |
181 | 184 |
182 } // namespace cc | 185 } // namespace cc |
OLD | NEW |