From f30b270652b285b73ca83fb77977c6712b230827 Mon Sep 17 00:00:00 2001 From: "gman@google.com" Date: Tue, 1 Sep 2009 19:08:31 +0000 Subject: Rename render_width and render_height to display_width and display_height in preparation for letting the user choose the backbuffer size. The issue is the current "render_width" and "render_height" really mean display_width and display_height where as the true "render_width" and "render_height" need to be different. Review URL: http://codereview.chromium.org/179058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25070 0039d316-1c4b-4281-b951-d872f2087c98 --- o3d/core/cross/client.cc | 8 ++++---- o3d/core/cross/gl/renderer_gl.cc | 6 +++--- o3d/core/cross/renderer.cc | 24 ++++++++++++------------ o3d/core/cross/renderer.h | 12 ++++++------ 4 files changed, 25 insertions(+), 25 deletions(-) (limited to 'o3d') diff --git a/o3d/core/cross/client.cc b/o3d/core/cross/client.cc index 996e97f..2e0224d 100644 --- a/o3d/core/cross/client.cc +++ b/o3d/core/cross/client.cc @@ -422,9 +422,9 @@ String Client::GetScreenshotAsDataURL() { // To take a screenshot we create a render target and render into it // then get a bitmap from that. int pot_width = - static_cast(image::ComputePOTSize(renderer_->render_width())); + static_cast(image::ComputePOTSize(renderer_->display_width())); int pot_height = - static_cast(image::ComputePOTSize(renderer_->render_height())); + static_cast(image::ComputePOTSize(renderer_->display_height())); if (pot_width == 0 || pot_height == 0) { return dataurl::kEmptyDataURL; } @@ -447,8 +447,8 @@ String Client::GetScreenshotAsDataURL() { if (depth.IsNull()) { return dataurl::kEmptyDataURL; } - surface->SetClipSize(renderer_->render_width(), renderer_->render_height()); - depth->SetClipSize(renderer_->render_width(), renderer_->render_height()); + surface->SetClipSize(renderer_->display_width(), renderer_->display_height()); + depth->SetClipSize(renderer_->display_width(), renderer_->display_height()); const RenderSurface* old_render_surface_; const RenderDepthStencilSurface* old_depth_surface_; diff --git a/o3d/core/cross/gl/renderer_gl.cc b/o3d/core/cross/gl/renderer_gl.cc index 1d01f4a..90fa3881 100644 --- a/o3d/core/cross/gl/renderer_gl.cc +++ b/o3d/core/cross/gl/renderer_gl.cc @@ -1194,15 +1194,15 @@ void RendererGL::SetViewportInPixels(int left, float max_z) { MakeCurrentLazy(); int vieport_top = - RenderSurfaceActive() ? top : render_height() - top - height; + RenderSurfaceActive() ? top : display_height() - top - height; ::glViewport(left, vieport_top, width, height); UpdateHelperConstant(width, height); // If it's the full client area turn off scissor test for speed. if (left == 0 && top == 0 && - width == render_width() && - height == render_height()) { + width == display_width() && + height == display_height()) { ::glDisable(GL_SCISSOR_TEST); } else { ::glScissor(left, vieport_top, width, height); diff --git a/o3d/core/cross/renderer.cc b/o3d/core/cross/renderer.cc index 12a4b42..9bc9cf5 100644 --- a/o3d/core/cross/renderer.cc +++ b/o3d/core/cross/renderer.cc @@ -120,8 +120,8 @@ Renderer::Renderer(ServiceLocator* service_locator) drawing_(false), width_(0), height_(0), - render_width_(0), - render_height_(0), + display_width_(0), + display_height_(0), dest_x_offset_(0), dest_y_offset_(0), supports_npot_(false) { @@ -241,8 +241,8 @@ void Renderer::SetErrorTexture(Texture* texture) { void Renderer::SetClientSize(int width, int height) { width_ = width; height_ = height; - render_width_ = width; - render_height_ = height; + display_width_ = width; + display_height_ = height; clear_client_ = true; } @@ -332,8 +332,8 @@ void Renderer::GetViewport(Float4* viewport, Float2* depth_range) { void Renderer::SetViewport(const Float4& rectangle, const Float2& depth_range) { viewport_ = rectangle; depth_range_ = depth_range; - int width = render_width(); - int height = render_height(); + int width = display_width(); + int height = display_height(); float float_width = static_cast(width); float float_height = static_cast(height); @@ -714,18 +714,18 @@ void Renderer::SetRenderSurfaces( current_render_surface_ = surface; current_depth_surface_ = depth_surface; if (surface) { - render_width_ = surface->clip_width(); - render_height_ = surface->clip_height(); + display_width_ = surface->clip_width(); + display_height_ = surface->clip_height(); } else { - render_width_ = depth_surface->clip_width(); - render_height_ = depth_surface->clip_height(); + display_width_ = depth_surface->clip_width(); + display_height_ = depth_surface->clip_height(); } } else { SetBackBufferPlatformSpecific(); current_render_surface_ = NULL; current_depth_surface_ = NULL; - render_width_ = width(); - render_height_ = height(); + display_width_ = width(); + display_height_ = height(); } // We must reset the viewport after each change in surfaces. SetViewport(viewport_, depth_range_); diff --git a/o3d/core/cross/renderer.h b/o3d/core/cross/renderer.h index 8c6f65d..3328e4d 100644 --- a/o3d/core/cross/renderer.h +++ b/o3d/core/cross/renderer.h @@ -404,13 +404,13 @@ class Renderer { } // Get the width of the buffer to which the renderer is drawing. - int render_width() const { - return render_width_; + int display_width() const { + return display_width_; } // Get the height of the buffer to which the renderer is drawing. - int render_height() const { - return render_height_; + int display_height() const { + return display_height_; } // Whether or not the underlying API (D3D or OpenGL) supports @@ -692,8 +692,8 @@ class Renderer { int width_; // width of the client area in pixels int height_; // height of the client area in pixels - int render_width_; // width of the thing we are rendering to. - int render_height_; // height of the thing we are rendering to. + int display_width_; // width of the thing we are rendering to. + int display_height_; // height of the thing we are rendering to. // X and Y offsets for destination rectangle. int dest_x_offset_; -- cgit v1.1