summaryrefslogtreecommitdiffstats
path: root/skia/ext/bitmap_platform_device_mac.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-14 16:58:55 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-14 16:58:55 +0000
commit87080c619c9d60f0ed3aa988d89b36c35eca95b1 (patch)
tree93d5c34a529858c1d891a55a092ee53efd06976b /skia/ext/bitmap_platform_device_mac.cc
parentc31085d9656ff79a389318ffc7afed0fd2cd296c (diff)
downloadchromium_src-87080c619c9d60f0ed3aa988d89b36c35eca95b1.zip
chromium_src-87080c619c9d60f0ed3aa988d89b36c35eca95b1.tar.gz
chromium_src-87080c619c9d60f0ed3aa988d89b36c35eca95b1.tar.bz2
Remove a bunch of base dependencies from skia/ext. The only nontrivial change is
in bitmap_platform_device_mac. The refcounting now matches the way the Windows file works. Review URL: http://codereview.chromium.org/17627 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8015 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext/bitmap_platform_device_mac.cc')
-rwxr-xr-xskia/ext/bitmap_platform_device_mac.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/skia/ext/bitmap_platform_device_mac.cc b/skia/ext/bitmap_platform_device_mac.cc
index f544684..9b4beb0 100755
--- a/skia/ext/bitmap_platform_device_mac.cc
+++ b/skia/ext/bitmap_platform_device_mac.cc
@@ -8,9 +8,9 @@
#include "SkMatrix.h"
#include "SkRegion.h"
+#include "SkTypes.h"
#include "SkUtils.h"
-#include "base/logging.h"
#include "skia/ext/skia_utils_mac.h"
namespace skia {
@@ -46,8 +46,7 @@ bool Constrain(int available_size, int* position, int *size) {
} // namespace
-class BitmapPlatformDeviceMac::BitmapPlatformDeviceMacData
- : public base::RefCounted<BitmapPlatformDeviceMacData> {
+class BitmapPlatformDeviceMac::BitmapPlatformDeviceMacData : public SkRefCnt {
public:
explicit BitmapPlatformDeviceMacData(CGContextRef bitmap);
@@ -58,7 +57,7 @@ class BitmapPlatformDeviceMac::BitmapPlatformDeviceMacData
}
void ReleaseBitmapContext() {
- DCHECK(bitmap_context_);
+ SkASSERT(bitmap_context_);
CGContextRelease(bitmap_context_);
bitmap_context_ = NULL;
}
@@ -95,7 +94,9 @@ class BitmapPlatformDeviceMac::BitmapPlatformDeviceMacData
CGContextRelease(bitmap_context_);
}
- DISALLOW_COPY_AND_ASSIGN(BitmapPlatformDeviceMacData);
+ // Disallow copy & assign.
+ BitmapPlatformDeviceMacData(const BitmapPlatformDeviceMacData&);
+ BitmapPlatformDeviceMacData& operator=(const BitmapPlatformDeviceMacData&);
};
BitmapPlatformDeviceMac::\
@@ -103,7 +104,7 @@ BitmapPlatformDeviceMac::\
CGContextRef bitmap)
: bitmap_context_(bitmap),
config_dirty_(true) { // Want to load the config next time.
- DCHECK(bitmap_context_);
+ SkASSERT(bitmap_context_);
// Initialize the clip region to the entire bitmap.
SkIRect rect;
@@ -203,14 +204,17 @@ BitmapPlatformDeviceMac::BitmapPlatformDeviceMac(
: PlatformDeviceMac(
const_cast<BitmapPlatformDeviceMac&>(other).accessBitmap(true)),
data_(other.data_) {
+ data_->ref();
}
BitmapPlatformDeviceMac::~BitmapPlatformDeviceMac() {
+ data_->unref();
}
BitmapPlatformDeviceMac& BitmapPlatformDeviceMac::operator=(
const BitmapPlatformDeviceMac& other) {
data_ = other.data_;
+ data_->ref();
return *this;
}