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

Unified Diff: cc/resources/picture_pile_impl.h

Issue 723343002: Update from https://crrev.com/304121 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « cc/resources/picture_pile_base.cc ('k') | cc/resources/picture_pile_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/picture_pile_impl.h
diff --git a/cc/resources/picture_pile_impl.h b/cc/resources/picture_pile_impl.h
index 9f350a9933c0bc18dbfd695dbfaf531f7e7a2392..6986db40e75d5db49a7c678147ea4ebcc4b2e4ad 100644
--- a/cc/resources/picture_pile_impl.h
+++ b/cc/resources/picture_pile_impl.h
@@ -13,7 +13,7 @@
#include "base/time/time.h"
#include "cc/base/cc_export.h"
#include "cc/debug/rendering_stats_instrumentation.h"
-#include "cc/resources/picture_pile_base.h"
+#include "cc/resources/picture_pile.h"
#include "cc/resources/raster_source.h"
#include "skia/ext/analysis_canvas.h"
#include "skia/ext/refptr.h"
@@ -21,12 +21,11 @@
namespace cc {
-// TODO(vmpstr): Clean up PicturePileBase and make it a member.
-class CC_EXPORT PicturePileImpl : public PicturePileBase, public RasterSource {
+class CC_EXPORT PicturePileImpl : public RasterSource {
public:
static scoped_refptr<PicturePileImpl> Create();
- static scoped_refptr<PicturePileImpl> CreateFromOther(
- const PicturePileBase* other);
+ static scoped_refptr<PicturePileImpl> CreateFromPicturePile(
+ const PicturePile* other);
// RasterSource overrides. See RasterSource header for full description.
// When slow-down-raster-scale-factor is set to a value greater than 1, the
@@ -35,6 +34,9 @@ class CC_EXPORT PicturePileImpl : public PicturePileBase, public RasterSource {
void PlaybackToCanvas(SkCanvas* canvas,
const gfx::Rect& canvas_rect,
float contents_scale) const override;
+ void PlaybackToSharedCanvas(SkCanvas* canvas,
+ const gfx::Rect& canvas_rect,
+ float contents_scale) const override;
void PerformSolidColorAnalysis(
const gfx::Rect& content_rect,
float contents_scale,
@@ -44,20 +46,18 @@ class CC_EXPORT PicturePileImpl : public PicturePileBase, public RasterSource {
std::vector<SkPixelRef*>* pixel_refs) const override;
bool CoversRect(const gfx::Rect& content_rect,
float contents_scale) const override;
- bool SuitableForDistanceFieldText() const override;
-
- // Raster into the canvas without applying clips.
- void RasterDirect(SkCanvas* canvas,
- const gfx::Rect& canvas_rect,
- float contents_scale) const;
+ void SetShouldAttemptToUseDistanceFieldText() override;
+ bool ShouldAttemptToUseDistanceFieldText() const override;
+ gfx::Size GetSize() const override;
+ bool IsSolidColor() const override;
+ SkColor GetSolidColor() const override;
+ bool HasRecordings() const override;
+ bool IsMask() const override;
// Tracing functionality.
- void DidBeginTracing();
- skia::RefPtr<SkPicture> GetFlattenedPicture();
-
- void set_likely_to_be_used_for_transform_animation() {
- likely_to_be_used_for_transform_animation_ = true;
- }
+ void DidBeginTracing() override;
+ void AsValueInto(base::debug::TracedValue* array) const override;
+ skia::RefPtr<SkPicture> GetFlattenedPicture() override;
// Iterator used to return SkPixelRefs from this picture pile.
// Public for testing.
@@ -87,10 +87,31 @@ class CC_EXPORT PicturePileImpl : public PicturePileBase, public RasterSource {
friend class PicturePile;
friend class PixelRefIterator;
+ // TODO(vmpstr): Change this when pictures are split from invalidation info.
+ using PictureMapKey = PicturePile::PictureMapKey;
+ using PictureMap = PicturePile::PictureMap;
+ using PictureInfo = PicturePile::PictureInfo;
+
PicturePileImpl();
- explicit PicturePileImpl(const PicturePileBase* other);
+ explicit PicturePileImpl(const PicturePile* other);
~PicturePileImpl() override;
+ int buffer_pixels() const { return tiling_.border_texels(); }
+
+ PictureMap picture_map_;
+ TilingData tiling_;
+ SkColor background_color_;
+ bool contents_opaque_;
+ bool contents_fill_bounds_completely_;
+ bool is_solid_color_;
+ SkColor solid_color_;
+ gfx::Rect recorded_viewport_;
+ bool has_any_recordings_;
+ bool is_mask_;
+ bool clear_canvas_with_debug_color_;
+ float min_contents_scale_;
+ int slow_down_raster_scale_factor_for_debug_;
+
private:
typedef std::map<const Picture*, Region> PictureRegionMap;
@@ -112,7 +133,13 @@ class CC_EXPORT PicturePileImpl : public PicturePileBase, public RasterSource {
float contents_scale,
bool is_analysis) const;
- bool likely_to_be_used_for_transform_animation_;
+ // An internal CanRaster check that goes to the picture_map rather than
+ // using the recorded_viewport hint.
+ bool CanRasterSlowTileCheck(const gfx::Rect& layer_rect) const;
+
+ gfx::Rect PaddedRect(const PictureMapKey& key) const;
+
+ bool should_attempt_to_use_distance_field_text_;
DISALLOW_COPY_AND_ASSIGN(PicturePileImpl);
};
« no previous file with comments | « cc/resources/picture_pile_base.cc ('k') | cc/resources/picture_pile_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698