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

Unified Diff: cc/layers/surface_layer.cc

Issue 2495373003: Match html canvas which is transferred to OffscreenCanvas to CSS style (Closed)
Patch Set: fix compilation error 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 side-by-side diff with in-line comments
Download patch
Index: cc/layers/surface_layer.cc
diff --git a/cc/layers/surface_layer.cc b/cc/layers/surface_layer.cc
index 0f8bd3380be1aa873bf5ed197dcafabad45a9c51..7f56830ed9c9577930a4569d02d329d8ace07c4f 100644
--- a/cc/layers/surface_layer.cc
+++ b/cc/layers/surface_layer.cc
@@ -51,8 +51,7 @@ scoped_refptr<SurfaceLayer> SurfaceLayer::Create(
SurfaceLayer::SurfaceLayer(const SatisfyCallback& satisfy_callback,
const RequireCallback& require_callback)
- : surface_scale_(1.f),
- satisfy_callback_(satisfy_callback),
+ : satisfy_callback_(satisfy_callback),
require_callback_(require_callback) {}
SurfaceLayer::~SurfaceLayer() {
@@ -62,11 +61,13 @@ SurfaceLayer::~SurfaceLayer() {
void SurfaceLayer::SetSurfaceId(const SurfaceId& surface_id,
float scale,
- const gfx::Size& size) {
+ const gfx::Size& size,
+ bool stretch_content_to_fill_bounds) {
SatisfyDestroySequence();
surface_id_ = surface_id;
surface_size_ = size;
surface_scale_ = scale;
+ stretch_content_to_fill_bounds_ = stretch_content_to_fill_bounds;
CreateNewDestroySequence();
UpdateDrawsContent(HasDrawableContent());
@@ -101,6 +102,7 @@ void SurfaceLayer::PushPropertiesTo(LayerImpl* layer) {
layer_impl->SetSurfaceId(surface_id_);
layer_impl->SetSurfaceSize(surface_size_);
layer_impl->SetSurfaceScale(surface_scale_);
+ layer_impl->SetStretchContentToFillBounds(stretch_content_to_fill_bounds_);
}
void SurfaceLayer::CreateNewDestroySequence() {

Powered by Google App Engine
This is Rietveld 408576698