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

Unified Diff: cc/layers/surface_layer.cc

Issue 723343002: Update from https://crrev.com/304121 (Closed) Base URL: git@github.com:domokit/mojo.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layers/surface_layer.h ('k') | cc/layers/surface_layer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/surface_layer.cc
diff --git a/cc/layers/surface_layer.cc b/cc/layers/surface_layer.cc
index f1909b4b9169098a8cc8e2050df4a87e218c55cb..ab6289ef4265d1b5a85ac275986fca0515a515bb 100644
--- a/cc/layers/surface_layer.cc
+++ b/cc/layers/surface_layer.cc
@@ -44,6 +44,7 @@ scoped_refptr<SurfaceLayer> SurfaceLayer::Create(
SurfaceLayer::SurfaceLayer(const SatisfyCallback& satisfy_callback,
const RequireCallback& require_callback)
: Layer(),
+ surface_scale_(1.f),
satisfy_callback_(satisfy_callback),
require_callback_(require_callback) {
}
@@ -53,9 +54,13 @@ SurfaceLayer::~SurfaceLayer() {
DCHECK(destroy_sequence_.is_null());
}
-void SurfaceLayer::SetSurfaceId(SurfaceId surface_id) {
+void SurfaceLayer::SetSurfaceId(SurfaceId surface_id,
+ float scale,
+ const gfx::Size& size) {
SatisfyDestroySequence();
surface_id_ = surface_id;
+ surface_size_ = size;
+ surface_scale_ = scale;
CreateNewDestroySequence();
UpdateDrawsContent(HasDrawableContent());
@@ -88,6 +93,15 @@ void SurfaceLayer::PushPropertiesTo(LayerImpl* layer) {
layer_impl->SetSurfaceId(surface_id_);
}
+void SurfaceLayer::CalculateContentsScale(float ideal_contents_scale,
+ float* contents_scale_x,
+ float* contents_scale_y,
+ gfx::Size* content_bounds) {
+ *content_bounds = surface_size_;
+ *contents_scale_x = surface_scale_;
+ *contents_scale_y = surface_scale_;
+}
+
void SurfaceLayer::CreateNewDestroySequence() {
DCHECK(destroy_sequence_.is_null());
if (layer_tree_host()) {
« no previous file with comments | « cc/layers/surface_layer.h ('k') | cc/layers/surface_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698