Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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/content_layer.h" | 5 #include "cc/layers/content_layer.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "cc/layers/content_layer_client.h" | 10 #include "cc/layers/content_layer_client.h" |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 138 | 138 |
| 139 can_use_lcd_text_last_frame_ = can_use_lcd_text(); | 139 can_use_lcd_text_last_frame_ = can_use_lcd_text(); |
| 140 if (client_) | 140 if (client_) |
| 141 client_->DidChangeLayerCanUseLCDText(); | 141 client_->DidChangeLayerCanUseLCDText(); |
| 142 } | 142 } |
| 143 | 143 |
| 144 bool ContentLayer::SupportsLCDText() const { | 144 bool ContentLayer::SupportsLCDText() const { |
| 145 return true; | 145 return true; |
| 146 } | 146 } |
| 147 | 147 |
| 148 | |
| 149 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
| |
| 150 if (!client_ || !DrawsContent()) | |
| 151 return skia::RefPtr<SkPicture>(); | |
| 152 | |
| 153 int width = bounds().width(); | |
| 154 int height = bounds().height(); | |
| 155 gfx::RectF opaque; | |
| 156 | |
| 157 skia::RefPtr<SkPicture> picture = skia::AdoptRef(new SkPicture); | |
| 158 SkCanvas* canvas = picture->beginRecording(width, height); | |
| 159 client_->PaintContents(canvas, gfx::Rect(width, height), &opaque); | |
| 160 picture->endRecording(); | |
| 161 return picture; | |
| 162 } | |
| 163 | |
| 148 } // namespace cc | 164 } // namespace cc |
| OLD | NEW |