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