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

Side by Side Diff: cc/playback/discardable_image_map.cc

Issue 2629233002: cc: Remove separate x/y raster scales. (Closed)
Patch Set: Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « cc/playback/discardable_image_map.h ('k') | cc/playback/discardable_image_map_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/playback/discardable_image_map.h" 5 #include "cc/playback/discardable_image_map.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <limits> 10 #include <limits>
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 244
245 void DiscardableImageMap::EndGeneratingMetadata() { 245 void DiscardableImageMap::EndGeneratingMetadata() {
246 images_rtree_.Build(all_images_, 246 images_rtree_.Build(all_images_,
247 [](const std::pair<DrawImage, gfx::Rect>& image) { 247 [](const std::pair<DrawImage, gfx::Rect>& image) {
248 return image.second; 248 return image.second;
249 }); 249 });
250 } 250 }
251 251
252 void DiscardableImageMap::GetDiscardableImagesInRect( 252 void DiscardableImageMap::GetDiscardableImagesInRect(
253 const gfx::Rect& rect, 253 const gfx::Rect& rect,
254 const gfx::SizeF& raster_scales, 254 float contents_scale,
255 std::vector<DrawImage>* images) const { 255 std::vector<DrawImage>* images) const {
256 std::vector<size_t> indices; 256 std::vector<size_t> indices;
257 images_rtree_.Search(rect, &indices); 257 images_rtree_.Search(rect, &indices);
258 for (size_t index : indices) 258 for (size_t index : indices)
259 images->push_back(all_images_[index].first.ApplyScale(raster_scales)); 259 images->push_back(all_images_[index].first.ApplyScale(contents_scale));
260 } 260 }
261 261
262 DiscardableImageMap::ScopedMetadataGenerator::ScopedMetadataGenerator( 262 DiscardableImageMap::ScopedMetadataGenerator::ScopedMetadataGenerator(
263 DiscardableImageMap* image_map, 263 DiscardableImageMap* image_map,
264 const gfx::Size& bounds) 264 const gfx::Size& bounds)
265 : image_map_(image_map), 265 : image_map_(image_map),
266 metadata_canvas_(image_map->BeginGeneratingMetadata(bounds)) {} 266 metadata_canvas_(image_map->BeginGeneratingMetadata(bounds)) {}
267 267
268 DiscardableImageMap::ScopedMetadataGenerator::~ScopedMetadataGenerator() { 268 DiscardableImageMap::ScopedMetadataGenerator::~ScopedMetadataGenerator() {
269 image_map_->EndGeneratingMetadata(); 269 image_map_->EndGeneratingMetadata();
270 } 270 }
271 271
272 } // namespace cc 272 } // namespace cc
OLDNEW
« no previous file with comments | « cc/playback/discardable_image_map.h ('k') | cc/playback/discardable_image_map_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698