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

Unified Diff: content/common/gpu/image_transport_surface_mac.cc

Issue 15685003: Part 2/3 (GL) of adding with device scale factor to transport surfaces (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Re-resolve against head Created 7 years, 7 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 | « content/common/gpu/image_transport_surface.cc ('k') | content/common/gpu/image_transport_surface_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/image_transport_surface_mac.cc
diff --git a/content/common/gpu/image_transport_surface_mac.cc b/content/common/gpu/image_transport_surface_mac.cc
index 62c3265d7b1bef31e78cf8a7c4853cd197418d0f..c27e47ae950a03ba167b4e27ebb38dd77b3211d2 100644
--- a/content/common/gpu/image_transport_surface_mac.cc
+++ b/content/common/gpu/image_transport_surface_mac.cc
@@ -59,7 +59,7 @@ class IOSurfaceImageTransportSurface : public gfx::NoOpGLSurfaceCGL,
virtual void OnBufferPresented(
const AcceleratedSurfaceMsg_BufferPresented_Params& params) OVERRIDE;
virtual void OnResizeViewACK() OVERRIDE;
- virtual void OnResize(gfx::Size size) OVERRIDE;
+ virtual void OnResize(gfx::Size size, float scale_factor) OVERRIDE;
virtual void SetLatencyInfo(const cc::LatencyInfo&) OVERRIDE;
private:
@@ -86,6 +86,7 @@ class IOSurfaceImageTransportSurface : public gfx::NoOpGLSurfaceCGL,
gfx::Size size_;
gfx::Size rounded_size_;
+ float scale_factor_;
// Whether or not we've successfully made the surface current once.
bool made_current_;
@@ -129,6 +130,7 @@ IOSurfaceImageTransportSurface::IOSurfaceImageTransportSurface(
texture_id_(0),
io_surface_handle_(0),
context_(NULL),
+ scale_factor_(1),
made_current_(false),
is_swap_buffers_pending_(false),
did_unschedule_(false) {
@@ -184,7 +186,7 @@ bool IOSurfaceImageTransportSurface::OnMakeCurrent(gfx::GLContext* context) {
if (made_current_)
return true;
- OnResize(gfx::Size(1, 1));
+ OnResize(gfx::Size(1, 1), 1.f);
made_current_ = true;
return true;
@@ -289,7 +291,8 @@ void IOSurfaceImageTransportSurface::OnResizeViewACK() {
NOTREACHED();
}
-void IOSurfaceImageTransportSurface::OnResize(gfx::Size size) {
+void IOSurfaceImageTransportSurface::OnResize(gfx::Size size,
+ float scale_factor) {
// This trace event is used in gpu_feature_browsertest.cc - the test will need
// to be updated if this event is changed or moved.
TRACE_EVENT2("gpu", "IOSurfaceImageTransportSurface::OnResize",
@@ -298,6 +301,7 @@ void IOSurfaceImageTransportSurface::OnResize(gfx::Size size) {
DCHECK(context_->IsCurrent(this));
size_ = size;
+ scale_factor_ = scale_factor;
CreateIOSurface();
}
« no previous file with comments | « content/common/gpu/image_transport_surface.cc ('k') | content/common/gpu/image_transport_surface_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698