Merge pull request #2498 from abarth/mozart_scale2

Fix device pixel ratios in Mozart for reals
This commit is contained in:
Adam Barth
2016-03-11 20:15:59 -08:00

View File

@@ -19,7 +19,9 @@ ChildSceneLayer::~ChildSceneLayer() {
void ChildSceneLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
transform_ = matrix;
transform_.postTranslate(offset_.x(), offset_.y());
transform_.preTranslate(offset_.x(), offset_.y());
float inverse_device_pixel_ratio = 1.f / device_pixel_ratio_;
transform_.preScale(inverse_device_pixel_ratio, inverse_device_pixel_ratio);
}
void ChildSceneLayer::Paint(PaintContext::ScopedFrame& frame) {
@@ -39,8 +41,8 @@ void ChildSceneLayer::UpdateScene(mojo::gfx::composition::SceneUpdate* update,
child_node->op->set_scene(mojo::gfx::composition::SceneNodeOp::New());
child_node->op->get_scene()->scene_resource_id = id;
child_node->content_clip = mojo::RectF::New();
child_node->content_clip->width = physical_size_.width() / device_pixel_ratio_;
child_node->content_clip->height = physical_size_.height() / device_pixel_ratio_;
child_node->content_clip->width = physical_size_.width();
child_node->content_clip->height = physical_size_.height();
child_node->content_transform = mojo::Transform::From(transform_);
update->nodes.insert(id, child_node.Pass());
container->child_node_ids.push_back(id);