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

Unified Diff: cc/resources/picture_pile_base.cc

Issue 362073002: cc: Remove all traces of SkPicture cloning. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 4 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
« no previous file with comments | « cc/resources/picture_pile_base.h ('k') | cc/resources/picture_pile_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/picture_pile_base.cc
diff --git a/cc/resources/picture_pile_base.cc b/cc/resources/picture_pile_base.cc
index 7f5e1a2342e6b0a7476622df5eafa1e0592755d4..4f84bd9bbfeeca0273e61ac81d7a78d878a27c0b 100644
--- a/cc/resources/picture_pile_base.cc
+++ b/cc/resources/picture_pile_base.cc
@@ -72,28 +72,6 @@ PicturePileBase::PicturePileBase(const PicturePileBase* other)
has_text_(other->has_text_) {
}
-PicturePileBase::PicturePileBase(const PicturePileBase* other,
- unsigned thread_index)
- : tiling_(other->tiling_),
- recorded_viewport_(other->recorded_viewport_),
- min_contents_scale_(other->min_contents_scale_),
- tile_grid_info_(other->tile_grid_info_),
- background_color_(other->background_color_),
- slow_down_raster_scale_factor_for_debug_(
- other->slow_down_raster_scale_factor_for_debug_),
- contents_opaque_(other->contents_opaque_),
- contents_fill_bounds_completely_(other->contents_fill_bounds_completely_),
- show_debug_picture_borders_(other->show_debug_picture_borders_),
- clear_canvas_with_debug_color_(other->clear_canvas_with_debug_color_),
- has_any_recordings_(other->has_any_recordings_),
- has_text_(other->has_text_) {
- for (PictureMap::const_iterator it = other->picture_map_.begin();
- it != other->picture_map_.end();
- ++it) {
- picture_map_[it->first] = it->second.CloneForThread(thread_index);
- }
-}
-
PicturePileBase::~PicturePileBase() {
}
@@ -191,12 +169,12 @@ bool PicturePileBase::CanRasterSlowTileCheck(
return true;
}
-gfx::Rect PicturePileBase::PaddedRect(const PictureMapKey& key) {
+gfx::Rect PicturePileBase::PaddedRect(const PictureMapKey& key) const {
gfx::Rect tile = tiling_.TileBounds(key.first, key.second);
return PadRect(tile);
}
-gfx::Rect PicturePileBase::PadRect(const gfx::Rect& rect) {
+gfx::Rect PicturePileBase::PadRect(const gfx::Rect& rect) const {
gfx::Rect padded_rect = rect;
padded_rect.Inset(
-buffer_pixels(), -buffer_pixels(), -buffer_pixels(), -buffer_pixels());
@@ -205,7 +183,7 @@ gfx::Rect PicturePileBase::PadRect(const gfx::Rect& rect) {
void PicturePileBase::AsValueInto(base::debug::TracedValue* pictures) const {
gfx::Rect tiling_rect(tiling_.tiling_size());
- std::set<void*> appended_pictures;
+ std::set<const void*> appended_pictures;
bool include_borders = true;
for (TilingData::Iterator tile_iter(&tiling_, tiling_rect, include_borders);
tile_iter;
@@ -214,7 +192,7 @@ void PicturePileBase::AsValueInto(base::debug::TracedValue* pictures) const {
if (map_iter == picture_map_.end())
continue;
- Picture* picture = map_iter->second.GetPicture();
+ const Picture* picture = map_iter->second.GetPicture();
if (picture && (appended_pictures.count(picture) == 0)) {
appended_pictures.insert(picture);
TracedValue::AppendIDRef(picture, pictures);
@@ -262,18 +240,10 @@ void PicturePileBase::PictureInfo::SetPicture(scoped_refptr<Picture> picture) {
picture_ = picture;
}
-Picture* PicturePileBase::PictureInfo::GetPicture() const {
+const Picture* PicturePileBase::PictureInfo::GetPicture() const {
return picture_.get();
}
-PicturePileBase::PictureInfo PicturePileBase::PictureInfo::CloneForThread(
- int thread_index) const {
- PictureInfo info = *this;
- if (picture_.get())
- info.picture_ = picture_->GetCloneForDrawingOnThread(thread_index);
- return info;
-}
-
float PicturePileBase::PictureInfo::GetInvalidationFrequency() const {
return invalidation_history_.count() /
static_cast<float>(INVALIDATION_FRAMES_TRACKED);
« no previous file with comments | « cc/resources/picture_pile_base.h ('k') | cc/resources/picture_pile_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698