diff options
author | maruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-12 15:22:13 +0000 |
---|---|---|
committer | maruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-12 15:22:13 +0000 |
commit | e1981f43505c69351e5786eac1bff1913f4c96db (patch) | |
tree | 9be2552eea732795716489cba689918dc5dd74a3 /chrome/common/gfx | |
parent | 169da8f5bba74250fe73f708a1a3b666b4fb2431 (diff) | |
download | chromium_src-e1981f43505c69351e5786eac1bff1913f4c96db.zip chromium_src-e1981f43505c69351e5786eac1bff1913f4c96db.tar.gz chromium_src-e1981f43505c69351e5786eac1bff1913f4c96db.tar.bz2 |
Cleanup a few files, reduce the number of includes.
Applied glint.
No code change, just moving around.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@713 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/gfx')
-rw-r--r-- | chrome/common/gfx/chrome_canvas.cc | 19 | ||||
-rw-r--r-- | chrome/common/gfx/chrome_canvas.h | 18 |
2 files changed, 22 insertions, 15 deletions
diff --git a/chrome/common/gfx/chrome_canvas.cc b/chrome/common/gfx/chrome_canvas.cc index 631d2f3..b73a407 100644 --- a/chrome/common/gfx/chrome_canvas.cc +++ b/chrome/common/gfx/chrome_canvas.cc @@ -27,14 +27,15 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include <limits> - #include "chrome/common/gfx/chrome_canvas.h" -#include "base/gfx/platform_canvas.h" +#include <limits> + #include "base/gfx/rect.h" #include "base/logging.h" #include "skia/include/SkShader.h" +#include "chrome/common/gfx/chrome_font.h" +#include "chrome/common/l10n_util.h" ChromeCanvas::ChromeCanvas(int width, int height, bool is_opaque) : gfx::PlatformCanvas(width, height, is_opaque) { @@ -226,7 +227,8 @@ void ChromeCanvas::DrawBitmapInt(const SkBitmap& bitmap, int src_x, int src_y, shader_scale.setScale( SkFloatToScalar(static_cast<float>(dest_w) / src_w), SkFloatToScalar(static_cast<float>(dest_h) / src_h)); - shader_scale.postTranslate(SkIntToScalar(dest_x - src_x), SkIntToScalar(dest_y - src_y)); + shader_scale.postTranslate(SkIntToScalar(dest_x - src_x), + SkIntToScalar(dest_y - src_y)); shader->setLocalMatrix(shader_scale); // Set up our paint to use the shader & release our reference (now just owned @@ -338,6 +340,15 @@ void ChromeCanvas::DrawStringInt(const std::wstring& text, HFONT font, getTopPlatformDevice().postProcessGDI(x, y, w, h); } +void ChromeCanvas::DrawStringInt(const std::wstring& text, + const ChromeFont& font, + const SkColor& color, + int x, int y, + int w, int h) { + DrawStringInt(text, font, color, x, y, w, h, + l10n_util::DefaultCanvasTextAlignment()); +} + // We make sure that LTR text we draw in an RTL context is modified // appropriately to make sure it maintains it LTR orientation. void ChromeCanvas::DoDrawText(HDC hdc, const std::wstring& text, diff --git a/chrome/common/gfx/chrome_canvas.h b/chrome/common/gfx/chrome_canvas.h index a291880..4c6d63d 100644 --- a/chrome/common/gfx/chrome_canvas.h +++ b/chrome/common/gfx/chrome_canvas.h @@ -27,16 +27,15 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef CHROME_COMMON_GFX_CHROME_CANVAS_H__ -#define CHROME_COMMON_GFX_CHROME_CANVAS_H__ +#ifndef CHROME_COMMON_GFX_CHROME_CANVAS_H_ +#define CHROME_COMMON_GFX_CHROME_CANVAS_H_ #include <windows.h> #include <string> #include "base/basictypes.h" #include "base/gfx/platform_canvas.h" -#include "chrome/common/gfx/chrome_font.h" -#include "chrome/common/l10n_util.h" +class ChromeFont; namespace gfx { class Rect; } @@ -155,10 +154,7 @@ class ChromeCanvas : public gfx::PlatformCanvas { // aligned to the left, vertically centered, clipped to the region. If the // text is too big, it is truncated and '...' is added to the end. void DrawStringInt(const std::wstring& text, const ChromeFont& font, - const SkColor& color, int x, int y, int w, int h) { - DrawStringInt(text, font, color, x, y, w, h, - l10n_util::DefaultCanvasTextAlignment()); - } + const SkColor& color, int x, int y, int w, int h); // Draws text with the specified color, font and location. The last argument // specifies flags for how the text should be rendered. It can be one of @@ -190,8 +186,8 @@ class ChromeCanvas : public gfx::PlatformCanvas { private: // Draws text with the specified color, font and location. The text is - // aligned to the left, vertically centered, clipped to the region. If the - // text is too big, it is truncated and '...' is added to the end. + // aligned to the left, vertically centered, clipped to the region. If the + // text is too big, it is truncated and '...' is added to the end. void DrawStringInt(const std::wstring& text, HFONT font, const SkColor& color, int x, int y, int w, int h, int flags); @@ -210,4 +206,4 @@ class ChromeCanvas : public gfx::PlatformCanvas { typedef gfx::CanvasPaintT<ChromeCanvas> ChromeCanvasPaint; -#endif // CHROME_COMMON_GFX_CHROME_CANVAS_H__ +#endif // CHROME_COMMON_GFX_CHROME_CANVAS_H_ |