summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreed@google.com <reed@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-08 13:17:44 +0000
committerreed@google.com <reed@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-08 13:17:44 +0000
commite2fb32c1d3c8c0618405f973c078dba2c176095d (patch)
tree60175b5b8704f0bbfd0cb9b7e1be91c13f356f5f
parentfe9dcce34a033d22bcc0985b8d2f2db41bf20736 (diff)
downloadchromium_src-e2fb32c1d3c8c0618405f973c078dba2c176095d.zip
chromium_src-e2fb32c1d3c8c0618405f973c078dba2c176095d.tar.gz
chromium_src-e2fb32c1d3c8c0618405f973c078dba2c176095d.tar.bz2
mirror of http://codereview.chromium.org/6732027/
Replace include with forward declarations. Remove #import ApplicationServices.h from platform_device_mac.h, and add it back to appropriate .cc files. This is motivated by a conflict between headers included by ApplicationServices.h and WebCore headers. The conflict occurs in WebMediaPlayerClientImpl.cpp if it modified to include platform_canvas.h. With this change, ReleaseBitmapContext() cannot be declared inline in the header, so it is moved to bitmap_platform_device_mac.cc. There is no functional change. This requires that http://trac.webkit.org/changeset/81979 land in the Chromium tree first. (81979 has landed in the WebKit tree.) Review URL: http://codereview.chromium.org/6816025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80926 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--skia/ext/bitmap_platform_device_data.h6
-rw-r--r--skia/ext/bitmap_platform_device_mac.cc7
-rw-r--r--skia/ext/platform_canvas_unittest.cc4
-rw-r--r--skia/ext/platform_device_mac.cc1
-rw-r--r--skia/ext/platform_device_mac.h4
5 files changed, 16 insertions, 6 deletions
diff --git a/skia/ext/bitmap_platform_device_data.h b/skia/ext/bitmap_platform_device_data.h
index 36e0ad5..ff9b74f 100644
--- a/skia/ext/bitmap_platform_device_data.h
+++ b/skia/ext/bitmap_platform_device_data.h
@@ -43,11 +43,7 @@ class BitmapPlatformDevice::BitmapPlatformDeviceData :
#endif
#if defined(__APPLE__)
- void ReleaseBitmapContext() {
- SkASSERT(bitmap_context_);
- CGContextRelease(bitmap_context_);
- bitmap_context_ = NULL;
- }
+ void ReleaseBitmapContext();
#endif // defined(__APPLE__)
// Sets the transform and clip operations. This will not update the CGContext,
diff --git a/skia/ext/bitmap_platform_device_mac.cc b/skia/ext/bitmap_platform_device_mac.cc
index 9a1dd5a..1713192 100644
--- a/skia/ext/bitmap_platform_device_mac.cc
+++ b/skia/ext/bitmap_platform_device_mac.cc
@@ -4,6 +4,7 @@
#include "skia/ext/bitmap_platform_device_mac.h"
+#import <ApplicationServices/ApplicationServices.h>
#include <time.h>
#include "base/mac/mac_util.h"
@@ -82,6 +83,12 @@ BitmapPlatformDevice::BitmapPlatformDeviceData::~BitmapPlatformDeviceData() {
CGContextRelease(bitmap_context_);
}
+void BitmapPlatformDevice::BitmapPlatformDeviceData::ReleaseBitmapContext() {
+ SkASSERT(bitmap_context_);
+ CGContextRelease(bitmap_context_);
+ bitmap_context_ = NULL;
+}
+
void BitmapPlatformDevice::BitmapPlatformDeviceData::SetMatrixClip(
const SkMatrix& transform,
const SkRegion& region) {
diff --git a/skia/ext/platform_canvas_unittest.cc b/skia/ext/platform_canvas_unittest.cc
index c804998..6e43be2 100644
--- a/skia/ext/platform_canvas_unittest.cc
+++ b/skia/ext/platform_canvas_unittest.cc
@@ -6,6 +6,10 @@
#include "build/build_config.h"
+#if defined(OS_MACOSX)
+#import <ApplicationServices/ApplicationServices.h>
+#endif
+
#if !defined(OS_WIN)
#include <unistd.h>
#endif
diff --git a/skia/ext/platform_device_mac.cc b/skia/ext/platform_device_mac.cc
index e18c402..73e814e 100644
--- a/skia/ext/platform_device_mac.cc
+++ b/skia/ext/platform_device_mac.cc
@@ -4,6 +4,7 @@
#include "skia/ext/bitmap_platform_device_mac.h"
+#import <ApplicationServices/ApplicationServices.h>
#include "skia/ext/skia_utils_mac.h"
#include "third_party/skia/include/core/SkMatrix.h"
#include "third_party/skia/include/core/SkPath.h"
diff --git a/skia/ext/platform_device_mac.h b/skia/ext/platform_device_mac.h
index 6ce6ddd..b65d791 100644
--- a/skia/ext/platform_device_mac.h
+++ b/skia/ext/platform_device_mac.h
@@ -6,9 +6,11 @@
#define SKIA_EXT_PLATFORM_DEVICE_MAC_H_
#pragma once
-#import <ApplicationServices/ApplicationServices.h>
#include "third_party/skia/include/core/SkDevice.h"
+typedef struct CGContext* CGContextRef;
+typedef struct CGRect CGRect;
+
class SkMatrix;
class SkPath;
class SkRegion;