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

Side by Side Diff: cc/resources/picture_pile_impl.cc

Issue 909353002: Move PixelRefMap and its Iterator out from Picture class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review comments Created 5 years, 10 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 <algorithm> 5 #include <algorithm>
6 #include <limits> 6 #include <limits>
7 #include <set> 7 #include <set>
8 8
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 #include "cc/base/region.h" 10 #include "cc/base/region.h"
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 picture_pile_->picture_map_.find(tile_iterator_.index()); 420 picture_pile_->picture_map_.find(tile_iterator_.index());
421 if (it == picture_pile_->picture_map_.end()) 421 if (it == picture_pile_->picture_map_.end())
422 continue; 422 continue;
423 423
424 const Picture* picture = it->second.GetPicture(); 424 const Picture* picture = it->second.GetPicture();
425 if (!picture || (processed_pictures_.count(picture) != 0) || 425 if (!picture || (processed_pictures_.count(picture) != 0) ||
426 !picture->WillPlayBackBitmaps()) 426 !picture->WillPlayBackBitmaps())
427 continue; 427 continue;
428 428
429 processed_pictures_.insert(picture); 429 processed_pictures_.insert(picture);
430 pixel_ref_iterator_ = Picture::PixelRefIterator(layer_rect_, picture); 430 pixel_ref_iterator_ = picture->GetPixelRefMapIterator(layer_rect_);
431 if (pixel_ref_iterator_) 431 if (pixel_ref_iterator_)
432 break; 432 break;
433 } 433 }
434 } 434 }
435 435
436 void PicturePileImpl::DidBeginTracing() { 436 void PicturePileImpl::DidBeginTracing() {
437 std::set<const void*> processed_pictures; 437 std::set<const void*> processed_pictures;
438 for (const auto& map_pair : picture_map_) { 438 for (const auto& map_pair : picture_map_) {
439 const Picture* picture = map_pair.second.GetPicture(); 439 const Picture* picture = map_pair.second.GetPicture();
440 if (picture && (processed_pictures.count(picture) == 0)) { 440 if (picture && (processed_pictures.count(picture) == 0)) {
441 picture->EmitTraceSnapshot(); 441 picture->EmitTraceSnapshot();
442 processed_pictures.insert(picture); 442 processed_pictures.insert(picture);
443 } 443 }
444 } 444 }
445 } 445 }
446 446
447 } // namespace cc 447 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698