diff options
author | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-02 17:59:12 +0000 |
---|---|---|
committer | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-02 17:59:12 +0000 |
commit | a2ecb1d1a7a1ffe57c7ad9750a4c9a9bfa9d4770 (patch) | |
tree | bff0e6eb061feff9f0bc6d0e21680aabb1fb0ed7 /skia | |
parent | 30de978415fee18ae4c6b401185f2df12a7e2268 (diff) | |
download | chromium_src-a2ecb1d1a7a1ffe57c7ad9750a4c9a9bfa9d4770.zip chromium_src-a2ecb1d1a7a1ffe57c7ad9750a4c9a9bfa9d4770.tar.gz chromium_src-a2ecb1d1a7a1ffe57c7ad9750a4c9a9bfa9d4770.tar.bz2 |
Revert 94905 - Remove (now obsolete) IsNativeFontRendering api
Review URL: http://codereview.chromium.org/7482045
- The webkit side of this change was reverted.
TBR=reed@google.com
Review URL: http://codereview.chromium.org/7518042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95108 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia')
-rw-r--r-- | skia/ext/platform_canvas.cc | 4 | ||||
-rw-r--r-- | skia/ext/platform_device_linux.cc | 4 | ||||
-rw-r--r-- | skia/ext/platform_device_linux.h | 3 | ||||
-rw-r--r-- | skia/ext/platform_device_mac.cc | 4 | ||||
-rw-r--r-- | skia/ext/platform_device_mac.h | 3 | ||||
-rw-r--r-- | skia/ext/platform_device_win.h | 3 | ||||
-rw-r--r-- | skia/ext/vector_platform_device_skia.cc | 4 | ||||
-rw-r--r-- | skia/ext/vector_platform_device_skia.h | 3 |
8 files changed, 27 insertions, 1 deletions
diff --git a/skia/ext/platform_canvas.cc b/skia/ext/platform_canvas.cc index 3318bf8..df7ded6 100644 --- a/skia/ext/platform_canvas.cc +++ b/skia/ext/platform_canvas.cc @@ -40,8 +40,10 @@ SkDevice* GetTopDevice(const SkCanvas& canvas) { } bool SupportsPlatformPaint(const SkCanvas* canvas) { + // TODO(alokp): Rename IsNativeFontRenderingAllowed after removing these + // calls from WebKit. PlatformDevice* platform_device = GetPlatformDevice(GetTopDevice(*canvas)); - return platform_device; + return platform_device && platform_device->IsNativeFontRenderingAllowed(); } PlatformSurface BeginPlatformPaint(SkCanvas* canvas) { diff --git a/skia/ext/platform_device_linux.cc b/skia/ext/platform_device_linux.cc index e817703..f633758 100644 --- a/skia/ext/platform_device_linux.cc +++ b/skia/ext/platform_device_linux.cc @@ -11,6 +11,10 @@ PlatformDevice::PlatformDevice(const SkBitmap& bitmap) SetPlatformDevice(this, this); } +bool PlatformDevice::IsNativeFontRenderingAllowed() { + return true; +} + void PlatformDevice::EndPlatformPaint() { // We don't need to do anything on Linux here. } diff --git a/skia/ext/platform_device_linux.h b/skia/ext/platform_device_linux.h index 3683b9b..51c292f 100644 --- a/skia/ext/platform_device_linux.h +++ b/skia/ext/platform_device_linux.h @@ -16,6 +16,9 @@ class PlatformDevice : public SkDevice { public: typedef cairo_t* PlatformSurface; + // Returns if native platform APIs are allowed to render text to this device. + virtual bool IsNativeFontRenderingAllowed(); + virtual PlatformSurface BeginPlatformPaint() = 0; virtual void EndPlatformPaint(); diff --git a/skia/ext/platform_device_mac.cc b/skia/ext/platform_device_mac.cc index 4060f31..9d2695f 100644 --- a/skia/ext/platform_device_mac.cc +++ b/skia/ext/platform_device_mac.cc @@ -27,6 +27,10 @@ PlatformDevice::PlatformDevice(const SkBitmap& bitmap) SetPlatformDevice(this, this); } +bool PlatformDevice::IsNativeFontRenderingAllowed() { + return true; +} + CGContextRef PlatformDevice::BeginPlatformPaint() { return GetBitmapContext(); } diff --git a/skia/ext/platform_device_mac.h b/skia/ext/platform_device_mac.h index a58e89a4..610f07f 100644 --- a/skia/ext/platform_device_mac.h +++ b/skia/ext/platform_device_mac.h @@ -47,6 +47,9 @@ class PlatformDevice : public SkDevice { // Sets the opacity of each pixel in the specified region to be opaque. virtual void MakeOpaque(int x, int y, int width, int height) { } + // Returns if native platform APIs are allowed to render text to this device. + virtual bool IsNativeFontRenderingAllowed(); + virtual PlatformSurface BeginPlatformPaint(); virtual void EndPlatformPaint(); diff --git a/skia/ext/platform_device_win.h b/skia/ext/platform_device_win.h index 4b1e034a..57afa89 100644 --- a/skia/ext/platform_device_win.h +++ b/skia/ext/platform_device_win.h @@ -49,6 +49,9 @@ class SK_API PlatformDevice : public SkDevice { // Sets the opacity of each pixel in the specified region to be opaque. virtual void MakeOpaque(int x, int y, int width, int height) { } + // Returns if GDI is allowed to render text to this device. + virtual bool IsNativeFontRenderingAllowed() { return true; } + // Loads a SkPath into the GDI context. The path can there after be used for // clipping or as a stroke. Returns false if the path failed to be loaded. static bool LoadPathToDC(HDC context, const SkPath& path); diff --git a/skia/ext/vector_platform_device_skia.cc b/skia/ext/vector_platform_device_skia.cc index 107cd5c..dbc5843 100644 --- a/skia/ext/vector_platform_device_skia.cc +++ b/skia/ext/vector_platform_device_skia.cc @@ -27,6 +27,10 @@ VectorPlatformDeviceSkia::VectorPlatformDeviceSkia(SkPDFDevice* pdf_device) VectorPlatformDeviceSkia::~VectorPlatformDeviceSkia() { } +bool VectorPlatformDeviceSkia::IsNativeFontRenderingAllowed() { + return false; +} + PlatformDevice::PlatformSurface VectorPlatformDeviceSkia::BeginPlatformPaint() { // Even when drawing a vector representation of the page, we have to // provide a raster surface for plugins to render into - they don't have diff --git a/skia/ext/vector_platform_device_skia.h b/skia/ext/vector_platform_device_skia.h index 07adf51..7aaa2a2 100644 --- a/skia/ext/vector_platform_device_skia.h +++ b/skia/ext/vector_platform_device_skia.h @@ -29,6 +29,9 @@ class VectorPlatformDeviceSkia : public PlatformDevice { SkPDFDevice* PdfDevice() { return pdf_device_.get(); } + // PlatformDevice methods. + virtual bool IsNativeFontRenderingAllowed(); + virtual PlatformSurface BeginPlatformPaint(); virtual void EndPlatformPaint(); #if defined(OS_WIN) |