diff options
author | pinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-22 20:14:37 +0000 |
---|---|---|
committer | pinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-22 20:14:37 +0000 |
commit | dc3d4ee1aef556cc630efbbdd23160792793044e (patch) | |
tree | 6a273efb78ac053a5b4745ff627b3b53f226b690 /webkit/port | |
parent | d2a10d134c864765e7015a62f20642f398adc721 (diff) | |
download | chromium_src-dc3d4ee1aef556cc630efbbdd23160792793044e.zip chromium_src-dc3d4ee1aef556cc630efbbdd23160792793044e.tar.gz chromium_src-dc3d4ee1aef556cc630efbbdd23160792793044e.tar.bz2 |
De-winify context headers in prep for future mac implementations. First step.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1239 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/port')
4 files changed, 20 insertions, 10 deletions
diff --git a/webkit/port/platform/graphics/PlatformContextSkia.cpp b/webkit/port/platform/graphics/PlatformContextSkia.cpp index c2586b3..4019578 100644 --- a/webkit/port/platform/graphics/PlatformContextSkia.cpp +++ b/webkit/port/platform/graphics/PlatformContextSkia.cpp @@ -31,7 +31,7 @@ #include "PlatformContextSkia.h" -PlatformContextSkia::PlatformContextSkia(gfx::PlatformCanvasWin* canvas) +PlatformContextSkia::PlatformContextSkia(gfx::PlatformCanvas* canvas) : SkGraphicsContext(canvas) { } diff --git a/webkit/port/platform/graphics/PlatformContextSkia.h b/webkit/port/platform/graphics/PlatformContextSkia.h index 6afde66..83e4e2c 100644 --- a/webkit/port/platform/graphics/PlatformContextSkia.h +++ b/webkit/port/platform/graphics/PlatformContextSkia.h @@ -47,7 +47,7 @@ class PlatformContextSkia : public SkGraphicsContext { friend class WebCore::GraphicsContextPlatformPrivate; public: // For printing, there shouldn't be any canvas. canvas can be NULL. - PlatformContextSkia(gfx::PlatformCanvasWin* canvas); + PlatformContextSkia(gfx::PlatformCanvas* canvas); ~PlatformContextSkia(); protected: diff --git a/webkit/port/platform/graphics/SkGraphicsContext.cpp b/webkit/port/platform/graphics/SkGraphicsContext.cpp index 0843840..51d7e51 100644 --- a/webkit/port/platform/graphics/SkGraphicsContext.cpp +++ b/webkit/port/platform/graphics/SkGraphicsContext.cpp @@ -146,7 +146,7 @@ void DrawResampledBitmap(SkCanvas& canvas, } // namespace -SkGraphicsContext::SkGraphicsContext(gfx::PlatformCanvasWin* canvas) +SkGraphicsContext::SkGraphicsContext(gfx::PlatformCanvas* canvas) : canvas_(canvas), paint_context_(NULL), own_canvas_(false) { @@ -425,7 +425,7 @@ const SkBitmap* SkGraphicsContext::bitmap() const return &canvas_->getDevice()->accessBitmap(false); } -gfx::PlatformCanvasWin* SkGraphicsContext::canvas() const +gfx::PlatformCanvas* SkGraphicsContext::canvas() const { return canvas_; } diff --git a/webkit/port/platform/graphics/SkGraphicsContext.h b/webkit/port/platform/graphics/SkGraphicsContext.h index 191dbf6..bbd3173 100644 --- a/webkit/port/platform/graphics/SkGraphicsContext.h +++ b/webkit/port/platform/graphics/SkGraphicsContext.h @@ -32,6 +32,8 @@ #include "SkPorterDuff.h" +#include "base/gfx/platform_canvas.h" + class NativeImageSkia; struct SkIRect; struct SkPoint; @@ -47,9 +49,15 @@ class UniscribeStateTextRun; namespace gfx { class NativeTheme; -class PlatformCanvasWin; } +#if defined(OS_WIN) +typedef HICON IconHandle; +typedef HFONT FontHandle; +#elif defined(OS_MACOSX) +typedef CGImageRef IconHandle; +typedef CTFontRef FontHandle; +#endif class SkGraphicsContext { public: @@ -67,13 +75,13 @@ class SkGraphicsContext { RESAMPLE_AWESOME, }; - SkGraphicsContext(gfx::PlatformCanvasWin* canvas); + SkGraphicsContext(gfx::PlatformCanvas* canvas); ~SkGraphicsContext(); // Gets the default theme. static const gfx::NativeTheme* nativeTheme(); - void paintIcon(HICON icon, const SkIRect& rect); + void paintIcon(IconHandle icon, const SkIRect& rect); void paintButton(const SkIRect& widgetRect, const ThemeData& themeData); void paintTextField(const SkIRect& widgetRect, @@ -88,11 +96,13 @@ class SkGraphicsContext { int from, int to, int ascent); - bool paintText(HFONT hfont, +#if defined(OS_WIN) + bool paintText(FontHandle hfont, int number_glyph, const WORD* glyphs, const int* advances, const SkPoint& origin); +#endif // TODO(maruel): I'm still unsure how I will serialize this call. void paintSkPaint(const SkRect& rect, const SkPaint& paint); @@ -130,7 +140,7 @@ class SkGraphicsContext { // Warning: This function is deprecated so the users are reminded that they // should use this layer of indirection instead of using the canvas directly. // This is to help with the eventual serialization. - gfx::PlatformCanvasWin* canvas() const; + gfx::PlatformCanvas* canvas() const; // Returns if the context is a printing context instead of a display context. // Bitmap shouldn't be resampled when printing to keep the best possible @@ -147,7 +157,7 @@ class SkGraphicsContext { SkPaintContext* paint_context_; // Can be NULL when serializing. - gfx::PlatformCanvasWin* canvas_; + gfx::PlatformCanvas* canvas_; // Signal that we own the canvas and must delete it on destruction. bool own_canvas_; |