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

Unified Diff: components/exo/surface.cc

Issue 2843723003: Make exo::Surface set device_scale_factor. (Closed)
Patch Set: Get device_scale_factor from aura::Window. Created 3 years, 8 months 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
« components/exo/surface.h ('K') | « components/exo/surface.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/surface.cc
diff --git a/components/exo/surface.cc b/components/exo/surface.cc
index f186ef93706b6d14d465c063e53e4b9035a3b029..2c614373b45f65d1b09bd785036e7de8b85ac71e 100644
--- a/components/exo/surface.cc
+++ b/components/exo/surface.cc
@@ -108,7 +108,9 @@ class CustomWindowDelegate : public aura::WindowDelegate {
bool CanFocus() override { return true; }
void OnCaptureLost() override {}
void OnPaint(const ui::PaintContext& context) override {}
- void OnDeviceScaleFactorChanged(float device_scale_factor) override {}
+ void OnDeviceScaleFactorChanged(float device_scale_factor) override {
+ surface_->SetDeviceScaleFactor(device_scale_factor);
+ }
void OnWindowDestroying(aura::Window* window) override {}
void OnWindowDestroyed(aura::Window* window) override { delete this; }
void OnWindowTargetVisibilityChanged(bool visible) override {}
@@ -405,6 +407,10 @@ void Surface::SetAlpha(float alpha) {
pending_state_.alpha = alpha;
}
+void Surface::SetDeviceScaleFactor(float device_scale_factor) {
+ device_scale_factor_ = device_scale_factor;
+}
+
void Surface::Commit() {
TRACE_EVENT0("exo", "Surface::Commit");
@@ -847,6 +853,7 @@ void Surface::UpdateSurface(bool full_damage) {
current_begin_frame_ack_.has_damage = true;
}
frame.metadata.begin_frame_ack = current_begin_frame_ack_;
+ frame.metadata.device_scale_factor = device_scale_factor_;
if (current_resource_.id) {
// Texture quad is only needed if buffer is not fully transparent.
« components/exo/surface.h ('K') | « components/exo/surface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698