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

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

Issue 719573003: Explicitly specify contents scale for SurfaceLayer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.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 unified diff | Download patch
« no previous file with comments | « ui/compositor/layer.h ('k') | no next file » | 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/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 567
568 frame_size_in_dip_ = frame_size_in_dip; 568 frame_size_in_dip_ = frame_size_in_dip;
569 RecomputeDrawsContentAndUVRect(); 569 RecomputeDrawsContentAndUVRect();
570 } 570 }
571 571
572 void Layer::SetShowSurface( 572 void Layer::SetShowSurface(
573 cc::SurfaceId surface_id, 573 cc::SurfaceId surface_id,
574 const cc::SurfaceLayer::SatisfyCallback& satisfy_callback, 574 const cc::SurfaceLayer::SatisfyCallback& satisfy_callback,
575 const cc::SurfaceLayer::RequireCallback& require_callback, 575 const cc::SurfaceLayer::RequireCallback& require_callback,
576 gfx::Size surface_size, 576 gfx::Size surface_size,
577 float scale,
577 gfx::Size frame_size_in_dip) { 578 gfx::Size frame_size_in_dip) {
578 DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR); 579 DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR);
579 580
580 scoped_refptr<cc::SurfaceLayer> new_layer = 581 scoped_refptr<cc::SurfaceLayer> new_layer =
581 cc::SurfaceLayer::Create(satisfy_callback, require_callback); 582 cc::SurfaceLayer::Create(satisfy_callback, require_callback);
582 new_layer->SetSurfaceId(surface_id, surface_size); 583 new_layer->SetSurfaceId(surface_id, scale, surface_size);
583 SwitchToLayer(new_layer); 584 SwitchToLayer(new_layer);
584 surface_layer_ = new_layer; 585 surface_layer_ = new_layer;
585 586
586 frame_size_in_dip_ = frame_size_in_dip; 587 frame_size_in_dip_ = frame_size_in_dip;
587 RecomputeDrawsContentAndUVRect(); 588 RecomputeDrawsContentAndUVRect();
588 } 589 }
589 590
590 void Layer::SetShowSolidColorContent() { 591 void Layer::SetShowSolidColorContent() {
591 DCHECK_EQ(type_, LAYER_SOLID_COLOR); 592 DCHECK_EQ(type_, LAYER_SOLID_COLOR);
592 593
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
1047 children_.end(), 1048 children_.end(),
1048 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), 1049 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection),
1049 collection)); 1050 collection));
1050 } 1051 }
1051 1052
1052 bool Layer::IsAnimating() const { 1053 bool Layer::IsAnimating() const {
1053 return animator_.get() && animator_->is_animating(); 1054 return animator_.get() && animator_->is_animating();
1054 } 1055 }
1055 1056
1056 } // namespace ui 1057 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/layer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698