diff options
author | pkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-23 01:48:12 +0000 |
---|---|---|
committer | pkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-23 01:48:12 +0000 |
commit | 28599f4802c403c4d362f734ba37f81b552be977 (patch) | |
tree | c6ff86f1d689da8ab25d29bbe55722976baa37ed /content/browser/renderer_host/dip_util.h | |
parent | 8ca4c95564702a77d3d149e436bc7a3ae9a08df1 (diff) | |
download | chromium_src-28599f4802c403c4d362f734ba37f81b552be977.zip chromium_src-28599f4802c403c4d362f734ba37f81b552be977.tar.gz chromium_src-28599f4802c403c4d362f734ba37f81b552be977.tar.bz2 |
Makes the browser send pixels to the GPU process where it should.
This patch fixes the places where we will be sending DIP to the GPU process but should be sending pixels instead to the GPU process once https://bugs.webkit.org/show_bug.cgi?id=86051 lands.
This patch reverts:
http://codereview.chromium.org/127553/
http://codereview.chromium.org/10332077/
Bug=127455, 114677
Test=Manual
SchedulePaintInRect is called with parameters in DIP
TBR=piman@chromium.org,sky@chromium.org,jamesr@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10411086
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138415 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/renderer_host/dip_util.h')
-rw-r--r-- | content/browser/renderer_host/dip_util.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/content/browser/renderer_host/dip_util.h b/content/browser/renderer_host/dip_util.h new file mode 100644 index 0000000..ac9ba9d --- /dev/null +++ b/content/browser/renderer_host/dip_util.h @@ -0,0 +1,40 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_RENDERER_HOST_DIP_UTIL_H_ +#define CONTENT_BROWSER_RENDERER_HOST_DIP_UTIL_H_ +#pragma once + +#include "content/common/content_export.h" + +namespace gfx { +class Point; +class Rect; +class Size; +} // namespace gfx + +namespace content { +class RenderWidgetHostView; + +// Returns scale factor used to convert from DIP to pixel coordinate systems. +// Returns 1.0 if DIP is not enabled. +CONTENT_EXPORT float GetDIPScaleFactor(const RenderWidgetHostView* view); + +// Utility functions that convert point/size/rect between DIP and pixel +// coordinate system. +CONTENT_EXPORT gfx::Point ConvertPointToDIP(const RenderWidgetHostView* view, + const gfx::Point& point_in_pixel); +CONTENT_EXPORT gfx::Size ConvertSizeToDIP(const RenderWidgetHostView* view, + const gfx::Size& size_in_pixel); +CONTENT_EXPORT gfx::Rect ConvertRectToDIP(const RenderWidgetHostView* view, + const gfx::Rect& rect_in_pixel); +CONTENT_EXPORT gfx::Point ConvertPointToPixel(const RenderWidgetHostView* view, + const gfx::Point& point_in_dip); +CONTENT_EXPORT gfx::Size ConvertSizeToPixel(const RenderWidgetHostView* view, + const gfx::Size& size_in_dip); +CONTENT_EXPORT gfx::Rect ConvertRectToPixel(const RenderWidgetHostView* view, + const gfx::Rect& rect_in_dip); +} // namespace content + +#endif // CONTENT_BROWSER_RENDERER_HOST_DIP_UTIL_H_ |