Chromium Code Reviews| Index: cc/layers/content_layer.cc |
| diff --git a/cc/layers/content_layer.cc b/cc/layers/content_layer.cc |
| index 2053ecbeac10f10610d30aa1be167270aa5808cf..c166c9232b446cfee695143705ffa549fc30dceb 100644 |
| --- a/cc/layers/content_layer.cc |
| +++ b/cc/layers/content_layer.cc |
| @@ -145,4 +145,20 @@ bool ContentLayer::SupportsLCDText() const { |
| return true; |
| } |
| + |
| +skia::RefPtr<SkPicture> ContentLayer::GetPicture() const { |
|
enne (OOO)
2013/08/19 23:01:09
It seems like you should also implement this in Pi
alokp
2013/08/19 23:08:37
Aren't PictureLayers created only if you are using
enne (OOO)
2013/08/19 23:17:21
Yes, PictureLayers are only created with impl-side
alokp
2013/08/19 23:37:20
I missed the "as well" part and did not realize th
|
| + if (!client_ || !DrawsContent()) |
| + return skia::RefPtr<SkPicture>(); |
| + |
| + int width = bounds().width(); |
| + int height = bounds().height(); |
| + gfx::RectF opaque; |
| + |
| + skia::RefPtr<SkPicture> picture = skia::AdoptRef(new SkPicture); |
| + SkCanvas* canvas = picture->beginRecording(width, height); |
| + client_->PaintContents(canvas, gfx::Rect(width, height), &opaque); |
| + picture->endRecording(); |
| + return picture; |
| +} |
| + |
| } // namespace cc |