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

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

Issue 2495373003: Match html canvas which is transferred to OffscreenCanvas to CSS style (Closed)
Patch Set: fix basedd on feedback Created 4 years 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 (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 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 const cc::SurfaceId& surface_id, 661 const cc::SurfaceId& surface_id,
662 const cc::SurfaceLayer::SatisfyCallback& satisfy_callback, 662 const cc::SurfaceLayer::SatisfyCallback& satisfy_callback,
663 const cc::SurfaceLayer::RequireCallback& require_callback, 663 const cc::SurfaceLayer::RequireCallback& require_callback,
664 gfx::Size surface_size, 664 gfx::Size surface_size,
665 float scale, 665 float scale,
666 gfx::Size frame_size_in_dip) { 666 gfx::Size frame_size_in_dip) {
667 DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR); 667 DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR);
668 668
669 scoped_refptr<cc::SurfaceLayer> new_layer = 669 scoped_refptr<cc::SurfaceLayer> new_layer =
670 cc::SurfaceLayer::Create(satisfy_callback, require_callback); 670 cc::SurfaceLayer::Create(satisfy_callback, require_callback);
671 new_layer->SetSurfaceId(surface_id, scale, surface_size); 671 new_layer->SetSurfaceId(surface_id, scale, surface_size, false);
danakj 2016/12/15 16:13:14 use a temp var or a comment to say the name of the
672 SwitchToLayer(new_layer); 672 SwitchToLayer(new_layer);
673 surface_layer_ = new_layer; 673 surface_layer_ = new_layer;
674 674
675 frame_size_in_dip_ = frame_size_in_dip; 675 frame_size_in_dip_ = frame_size_in_dip;
676 RecomputeDrawsContentAndUVRect(); 676 RecomputeDrawsContentAndUVRect();
677 677
678 for (const auto& mirror : mirrors_) { 678 for (const auto& mirror : mirrors_) {
679 mirror->dest()->SetShowSurface( 679 mirror->dest()->SetShowSurface(
680 surface_id, satisfy_callback, require_callback, 680 surface_id, satisfy_callback, require_callback,
681 surface_size, scale, frame_size_in_dip); 681 surface_size, scale, frame_size_in_dip);
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
1175 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(), 1175 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(),
1176 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) { 1176 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) {
1177 return mirror_ptr.get() == mirror; 1177 return mirror_ptr.get() == mirror;
1178 }); 1178 });
1179 1179
1180 DCHECK(it != mirrors_.end()); 1180 DCHECK(it != mirrors_.end());
1181 mirrors_.erase(it); 1181 mirrors_.erase(it);
1182 } 1182 }
1183 1183
1184 } // namespace ui 1184 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698