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

Unified Diff: remoting/client/plugin/pepper_view.h

Issue 10785041: Make Chromoting client plugin always render at device DPI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase & fix typos. 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 | « remoting/client/plugin/chromoting_instance.cc ('k') | remoting/client/plugin/pepper_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/plugin/pepper_view.h
diff --git a/remoting/client/plugin/pepper_view.h b/remoting/client/plugin/pepper_view.h
index 68446e49458c948a1e19d799afaf1cd66cc6b6bf..cd015f0246dd558ed7dd4edeedf4aee53e57c40a 100644
--- a/remoting/client/plugin/pepper_view.h
+++ b/remoting/client/plugin/pepper_view.h
@@ -12,6 +12,7 @@
#include "base/memory/weak_ptr.h"
#include "ppapi/cpp/graphics_2d.h"
+#include "ppapi/cpp/view.h"
#include "ppapi/cpp/point.h"
#include "remoting/client/frame_consumer.h"
@@ -44,10 +45,10 @@ class PepperView : public FrameConsumer,
virtual void SetSourceSize(const SkISize& source_size,
const SkIPoint& dpi) OVERRIDE;
- // Sets the display size and clipping area of this view.
- void SetView(const SkISize& view_size, const SkIRect& clip_area);
+ // Updates the PepperView's size, clipping area and scale factor.
+ void SetView(const pp::View& view);
- // Return the client view and original host dimensions.
+ // Return the dimensions of the view and source in device pixels.
const SkISize& get_view_size() const {
return view_size_;
}
@@ -55,6 +56,12 @@ class PepperView : public FrameConsumer,
return source_size_;
}
+ // Return the dimensions of the view in Density Independent Pixels (DIPs).
+ // On high-DPI devices this will be smaller than the size in device pixels.
+ const SkISize& get_view_size_dips() const {
+ return view_size_dips_;
+ }
+
private:
// This routine allocates an image buffer.
pp::ImageData* AllocateBuffer();
@@ -91,22 +98,25 @@ class PepperView : public FrameConsumer,
// List of allocated image buffers.
std::list<pp::ImageData*> buffers_;
+ // Queued buffer to paint, with clip area and dirty region in device pixels.
pp::ImageData* merge_buffer_;
SkIRect merge_clip_area_;
SkRegion merge_region_;
- // The size of the plugin element.
+ // View size, clip area and host dimensions, in device pixels.
SkISize view_size_;
-
- // The current clip area rectangle.
SkIRect clip_area_;
-
- // The size of the host screen.
SkISize source_size_;
// The DPI of the host screen.
SkIPoint source_dpi_;
+ // View size in Density-Independent pixels.
+ SkISize view_size_dips_;
+
+ // DIP-to-device pixel scale factor.
+ float view_scale_;
+
// True if there is already a Flush() pending on the Graphics2D context.
bool flush_pending_;
« no previous file with comments | « remoting/client/plugin/chromoting_instance.cc ('k') | remoting/client/plugin/pepper_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698