Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(484)

Unified Diff: cc/resources/picture_pile_impl.cc

Issue 666273002: cc: Added raster source. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reviews Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/resources/picture_pile_impl.cc
diff --git a/cc/resources/picture_pile_impl.cc b/cc/resources/picture_pile_impl.cc
index e8cee1e0435ffc6415f8d710faabefd19f22038d..5691d77089b25f767aaf1343bfa948d9fbd9df1f 100644
--- a/cc/resources/picture_pile_impl.cc
+++ b/cc/resources/picture_pile_impl.cc
@@ -41,7 +41,7 @@ void PicturePileImpl::RasterDirect(
SkCanvas* canvas,
const gfx::Rect& canvas_rect,
float contents_scale,
- RenderingStatsInstrumentation* rendering_stats_instrumentation) {
+ RenderingStatsInstrumentation* rendering_stats_instrumentation) const {
RasterCommon(canvas,
NULL,
canvas_rect,
@@ -322,16 +322,10 @@ skia::RefPtr<SkPicture> PicturePileImpl::GetFlattenedPicture() {
return picture;
}
-void PicturePileImpl::AnalyzeInRect(const gfx::Rect& content_rect,
- float contents_scale,
- PicturePileImpl::Analysis* analysis) const {
- AnalyzeInRect(content_rect, contents_scale, analysis, NULL);
-}
-
void PicturePileImpl::AnalyzeInRect(
const gfx::Rect& content_rect,
float contents_scale,
- PicturePileImpl::Analysis* analysis,
+ RasterSource::Analysis* analysis,
RenderingStatsInstrumentation* stats_instrumentation) const {
DCHECK(analysis);
TRACE_EVENT0("cc", "PicturePileImpl::AnalyzeInRect");
@@ -348,14 +342,24 @@ void PicturePileImpl::AnalyzeInRect(
analysis->is_solid_color = canvas.GetColorIfSolid(&analysis->solid_color);
}
-// Since there are situations when we can skip analysis, the variables have to
-// be set to their safest values. That is, we have to assume that the tile is
-// not solid color. As well, we have to assume that the tile has text so we
-// don't early out incorrectly.
-PicturePileImpl::Analysis::Analysis() : is_solid_color(false) {
+void PicturePileImpl::GatherPixelRefs(
+ const gfx::Rect& content_rect,
+ float contents_scale,
+ std::vector<SkPixelRef*>* pixel_refs) const {
+ DCHECK_EQ(0u, pixel_refs->size());
+ for (PixelRefIterator iter(content_rect, contents_scale, this); iter;
+ ++iter) {
+ pixel_refs->push_back(*iter);
+ }
+}
+
+bool PicturePileImpl::RasterCoversRect(const gfx::Rect& content_rect,
+ float contents_scale) const {
+ return CanRaster(contents_scale, content_rect);
}
-PicturePileImpl::Analysis::~Analysis() {
+bool PicturePileImpl::SuitableForDistanceFieldText() const {
+ return likely_to_be_used_for_transform_animation_;
}
PicturePileImpl::PixelRefIterator::PixelRefIterator(

Powered by Google App Engine
This is Rietveld 408576698