diff options
Diffstat (limited to 'app')
-rwxr-xr-x[-rw-r--r--] | app/gfx/canvas.h | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | app/gfx/canvas_linux.cc | 8 | ||||
-rwxr-xr-x | app/gfx/canvas_paint.h | 22 | ||||
-rw-r--r-- | app/gfx/canvas_win.cc | 4 |
4 files changed, 29 insertions, 9 deletions
diff --git a/app/gfx/canvas.h b/app/gfx/canvas.h index e1d20b8..0fe258a 100644..100755 --- a/app/gfx/canvas.h +++ b/app/gfx/canvas.h @@ -208,10 +208,6 @@ class Canvas : public skia::PlatformCanvas { DISALLOW_COPY_AND_ASSIGN(Canvas); }; -#if defined(OS_WIN) || defined(OS_LINUX) -typedef skia::CanvasPaintT<Canvas> CanvasPaint; -#endif - } // namespace gfx; #endif // #ifndef APP_GFX_CANVAS_H_ diff --git a/app/gfx/canvas_linux.cc b/app/gfx/canvas_linux.cc index 3b363f8..6751115 100644..100755 --- a/app/gfx/canvas_linux.cc +++ b/app/gfx/canvas_linux.cc @@ -4,7 +4,9 @@ #include "app/gfx/canvas.h" +#include <cairo/cairo.h> #include <pango/pango.h> +#include <pango/pangocairo.h> #include "app/gfx/font.h" #include "base/gfx/rect.h" @@ -44,10 +46,10 @@ PangoFontDescription* PangoFontFromGfxFont(const gfx::Font& gfx_font) { namespace gfx { Canvas::Canvas(int width, int height, bool is_opaque) - : skia::PlatformCanvasLinux(width, height, is_opaque) { + : skia::PlatformCanvas(width, height, is_opaque) { } -Canvas::Canvas() : skia::PlatformCanvasLinux() { +Canvas::Canvas() : skia::PlatformCanvas() { } Canvas::~Canvas() { @@ -58,7 +60,7 @@ void Canvas::SizeStringInt(const std::wstring& text, const gfx::Font& font, int* width, int* height, int flags) { cairo_surface_t* surface = - cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 0, 0); + cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 0, 0); cairo_t* cr = cairo_create(surface); PangoLayout* layout = pango_cairo_create_layout(cr); diff --git a/app/gfx/canvas_paint.h b/app/gfx/canvas_paint.h new file mode 100755 index 0000000..0b3c2a7 --- /dev/null +++ b/app/gfx/canvas_paint.h @@ -0,0 +1,22 @@ +// Copyright (c) 2009 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 APP_GFX_CANVAS_PAINT_H_
+#define APP_GFX_CANVAS_PAINT_H_
+
+#include "app/gfx/canvas.h"
+#include "skia/ext/canvas_paint.h"
+
+// Define a skia::CanvasPaint type that wraps our gfx::Canvas like the
+// skia::PlatformCanvasPaint wraps PlatformCanvas.
+
+namespace gfx {
+
+#if defined(OS_WIN) || defined(OS_LINUX)
+typedef skia::CanvasPaintT<Canvas> CanvasPaint;
+#endif
+
+} // namespace gfx
+
+#endif // APP_GFX_CANVAS_PAINT_H_
diff --git a/app/gfx/canvas_win.cc b/app/gfx/canvas_win.cc index 2d818d4..9f70136 100644 --- a/app/gfx/canvas_win.cc +++ b/app/gfx/canvas_win.cc @@ -120,10 +120,10 @@ int ComputeFormatFlags(int flags, const std::wstring& text) { namespace gfx { Canvas::Canvas(int width, int height, bool is_opaque) - : skia::PlatformCanvasWin(width, height, is_opaque) { + : skia::PlatformCanvas(width, height, is_opaque) { } -Canvas::Canvas() : skia::PlatformCanvasWin() { +Canvas::Canvas() : skia::PlatformCanvas() { } Canvas::~Canvas() { |