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

Side by Side Diff: ui/compositor/layer.cc

Issue 1427543002: Modified old wait sync point functions to also accept new sync tokens. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: format Created 5 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 unified diff | Download patch
« no previous file with comments | « ui/aura/bench/bench_main.cc ('k') | ui/compositor/layer_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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "ui/compositor/layer.h" 5 #include "ui/compositor/layer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 scoped_refptr<cc::TextureLayer> new_layer = 546 scoped_refptr<cc::TextureLayer> new_layer =
547 cc::TextureLayer::CreateForMailbox(UILayerSettings(), this); 547 cc::TextureLayer::CreateForMailbox(UILayerSettings(), this);
548 new_layer->SetFlipped(true); 548 new_layer->SetFlipped(true);
549 SwitchToLayer(new_layer); 549 SwitchToLayer(new_layer);
550 texture_layer_ = new_layer; 550 texture_layer_ = new_layer;
551 // Reset the frame_size_in_dip_ so that SetTextureSize() will not early out, 551 // Reset the frame_size_in_dip_ so that SetTextureSize() will not early out,
552 // the frame_size_in_dip_ was for a previous (different) |texture_layer_|. 552 // the frame_size_in_dip_ was for a previous (different) |texture_layer_|.
553 frame_size_in_dip_ = gfx::Size(); 553 frame_size_in_dip_ = gfx::Size();
554 } 554 }
555 if (mailbox_release_callback_) 555 if (mailbox_release_callback_)
556 mailbox_release_callback_->Run(0, false); 556 mailbox_release_callback_->Run(gpu::SyncToken(), false);
557 mailbox_release_callback_ = release_callback.Pass(); 557 mailbox_release_callback_ = release_callback.Pass();
558 mailbox_ = mailbox; 558 mailbox_ = mailbox;
559 SetTextureSize(texture_size_in_dip); 559 SetTextureSize(texture_size_in_dip);
560 } 560 }
561 561
562 void Layer::SetTextureSize(gfx::Size texture_size_in_dip) { 562 void Layer::SetTextureSize(gfx::Size texture_size_in_dip) {
563 DCHECK(texture_layer_.get()); 563 DCHECK(texture_layer_.get());
564 if (frame_size_in_dip_ == texture_size_in_dip) 564 if (frame_size_in_dip_ == texture_size_in_dip)
565 return; 565 return;
566 frame_size_in_dip_ = texture_size_in_dip; 566 frame_size_in_dip_ = texture_size_in_dip;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 if (solid_color_layer_.get()) 616 if (solid_color_layer_.get())
617 return; 617 return;
618 618
619 scoped_refptr<cc::SolidColorLayer> new_layer = 619 scoped_refptr<cc::SolidColorLayer> new_layer =
620 cc::SolidColorLayer::Create(UILayerSettings()); 620 cc::SolidColorLayer::Create(UILayerSettings());
621 SwitchToLayer(new_layer); 621 SwitchToLayer(new_layer);
622 solid_color_layer_ = new_layer; 622 solid_color_layer_ = new_layer;
623 623
624 mailbox_ = cc::TextureMailbox(); 624 mailbox_ = cc::TextureMailbox();
625 if (mailbox_release_callback_) { 625 if (mailbox_release_callback_) {
626 mailbox_release_callback_->Run(0, false); 626 mailbox_release_callback_->Run(gpu::SyncToken(), false);
627 mailbox_release_callback_.reset(); 627 mailbox_release_callback_.reset();
628 } 628 }
629 RecomputeDrawsContentAndUVRect(); 629 RecomputeDrawsContentAndUVRect();
630 } 630 }
631 631
632 void Layer::UpdateNinePatchLayerImage(const gfx::ImageSkia& image) { 632 void Layer::UpdateNinePatchLayerImage(const gfx::ImageSkia& image) {
633 DCHECK(type_ == LAYER_NINE_PATCH && nine_patch_layer_.get()); 633 DCHECK(type_ == LAYER_NINE_PATCH && nine_patch_layer_.get());
634 nine_patch_layer_image_ = image; 634 nine_patch_layer_image_ = image;
635 SkBitmap bitmap = nine_patch_layer_image_.GetRepresentation( 635 SkBitmap bitmap = nine_patch_layer_image_.GetRepresentation(
636 device_scale_factor_).sk_bitmap(); 636 device_scale_factor_).sk_bitmap();
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
1092 animator_->RemoveFromCollection(collection); 1092 animator_->RemoveFromCollection(collection);
1093 for (auto* child : children_) 1093 for (auto* child : children_)
1094 child->RemoveAnimatorsInTreeFromCollection(collection); 1094 child->RemoveAnimatorsInTreeFromCollection(collection);
1095 } 1095 }
1096 1096
1097 bool Layer::IsAnimating() const { 1097 bool Layer::IsAnimating() const {
1098 return animator_.get() && animator_->is_animating(); 1098 return animator_.get() && animator_->is_animating();
1099 } 1099 }
1100 1100
1101 } // namespace ui 1101 } // namespace ui
OLDNEW
« no previous file with comments | « ui/aura/bench/bench_main.cc ('k') | ui/compositor/layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698