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

Unified Diff: remoting/host/video_frame_capturer_mac.mm

Issue 10824035: Send correct DPI to client. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/video_frame_capturer_mac.mm
diff --git a/remoting/host/video_frame_capturer_mac.mm b/remoting/host/video_frame_capturer_mac.mm
index 2b8cf5aef20d64321726571311f69f0a2a05763c..ca111b1b09df8837fff1afaf24509e907b8d0d31 100644
--- a/remoting/host/video_frame_capturer_mac.mm
+++ b/remoting/host/video_frame_capturer_mac.mm
@@ -118,6 +118,7 @@ class VideoFrameBuffer {
public:
VideoFrameBuffer() :
size_(SkISize::Make(0, 0)),
+ dpi_(SkIPoint::Make(0, 0)),
bytes_per_row_(0),
needs_update_(true) {
}
@@ -137,10 +138,15 @@ class VideoFrameBuffer {
size_t buffer_size = width * height * sizeof(uint32_t);
ptr_.reset(new uint8[buffer_size]);
}
+ NSScreen* screen = [NSScreen mainScreen];
+ NSDictionary* attr = [screen deviceDescription];
+ NSSize resolution = [[attr objectForKey: NSDeviceResolution] sizeValue];
Lambros 2012/07/26 01:21:59 nit: no space after colon
+ dpi_.set(resolution.width, resolution.height);
}
}
SkISize size() const { return size_; }
+ SkIPoint dpi() const { return dpi_; }
int bytes_per_row() const { return bytes_per_row_; }
uint8* ptr() const { return ptr_.get(); }
@@ -148,6 +154,7 @@ class VideoFrameBuffer {
private:
SkISize size_;
+ SkIPoint dpi_;
int bytes_per_row_;
scoped_array<uint8> ptr_;
bool needs_update_;
@@ -392,6 +399,7 @@ void VideoFrameCapturerMac::CaptureInvalidRegion(
}
data = new CaptureData(planes, current_buffer.size(), pixel_format());
+ data->set_dpi(current_buffer.dpi());
data->mutable_dirty_region() = region;
current_buffer_ = (current_buffer_ + 1) % kNumBuffers;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698