summaryrefslogtreecommitdiffstats
path: root/skia/ext/bitmap_platform_device_mac.cc
diff options
context:
space:
mode:
authorbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-17 23:29:40 +0000
committerbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-17 23:29:40 +0000
commit21f527e6a4a812b604dd0891b27878d8418c04d9 (patch)
tree4dec5cb778e0b0755606f1d2113b3b6097188f85 /skia/ext/bitmap_platform_device_mac.cc
parentf8a2599cd63347322133ffa5c89195d66dc3d4b3 (diff)
downloadchromium_src-21f527e6a4a812b604dd0891b27878d8418c04d9.zip
chromium_src-21f527e6a4a812b604dd0891b27878d8418c04d9.tar.gz
chromium_src-21f527e6a4a812b604dd0891b27878d8418c04d9.tar.bz2
Move the "platform" wrappers in skia/ext to the skia namespace.
Review URL: http://codereview.chromium.org/14110 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7182 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext/bitmap_platform_device_mac.cc')
-rwxr-xr-xskia/ext/bitmap_platform_device_mac.cc26
1 files changed, 13 insertions, 13 deletions
diff --git a/skia/ext/bitmap_platform_device_mac.cc b/skia/ext/bitmap_platform_device_mac.cc
index 52ce586..b338c9f 100755
--- a/skia/ext/bitmap_platform_device_mac.cc
+++ b/skia/ext/bitmap_platform_device_mac.cc
@@ -13,7 +13,7 @@
#include "base/logging.h"
#include "skia/ext/skia_utils_mac.h"
-namespace gfx {
+namespace skia {
namespace {
@@ -23,7 +23,7 @@ namespace {
bool Constrain(int available_size, int* position, int *size) {
if (*size < -2)
return false;
-
+
if (*position < 0) {
if (*size != -1)
*size += *position;
@@ -31,7 +31,7 @@ bool Constrain(int available_size, int* position, int *size) {
}
if (*size == 0 || *position >= available_size)
return false;
-
+
if (*size > 0) {
int overflow = (*position + *size) - available_size;
if (overflow > 0) {
@@ -44,7 +44,7 @@ bool Constrain(int available_size, int* position, int *size) {
return true;
}
-} // namespace
+} // namespace
class BitmapPlatformDeviceMac::BitmapPlatformDeviceMacData
: public base::RefCounted<BitmapPlatformDeviceMacData> {
@@ -104,8 +104,8 @@ BitmapPlatformDeviceMac::\
: bitmap_context_(bitmap),
config_dirty_(true) { // Want to load the config next time.
DCHECK(bitmap_context_);
- // Initialize the clip region to the entire bitmap.
-
+ // Initialize the clip region to the entire bitmap.
+
SkIRect rect;
rect.set(0, 0,
CGBitmapContextGetWidth(bitmap_context_),
@@ -151,12 +151,12 @@ BitmapPlatformDeviceMac* BitmapPlatformDeviceMac::Create(CGContextRef context,
SkBitmap bitmap;
bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height);
bitmap.setPixels(data);
-
+
// Note: The Windows implementation clears the Bitmap later on.
// This bears mentioning since removal of this line makes the
// unit tests only fail periodically (or when MallocPreScribble is set).
bitmap.eraseARGB(0, 0, 0, 0);
-
+
bitmap.setIsOpaque(is_opaque);
if (is_opaque) {
@@ -166,14 +166,14 @@ BitmapPlatformDeviceMac* BitmapPlatformDeviceMac::Create(CGContextRef context,
bitmap.eraseARGB(255, 0, 255, 128); // bright bluish green
#endif
}
-
+
CGColorSpaceRef color_space =
CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
// allocate a bitmap context with 4 components per pixel (RGBA):
CGContextRef bitmap_context =
CGBitmapContextCreate(data, width, height, 8, width*4,
color_space, kCGImageAlphaPremultipliedLast);
-
+
// Change the coordinate system to match WebCore's
CGContextTranslateCTM(bitmap_context, 0, height);
CGContextScaleCTM(bitmap_context, 1.0, -1.0);
@@ -251,7 +251,7 @@ void BitmapPlatformDeviceMac::DrawToContext(CGContextRef context, int x, int y,
if (created_dc)
data_->ReleaseBitmapContext();
}
-
+
// Returns the color value at the specified location.
SkColor BitmapPlatformDeviceMac::getColorAt(int x, int y) {
const SkBitmap& bitmap = accessBitmap(true);
@@ -265,7 +265,7 @@ void BitmapPlatformDeviceMac::onAccessBitmap(SkBitmap*) {
}
void BitmapPlatformDeviceMac::processPixels(int x, int y,
- int width, int height,
+ int width, int height,
adjustAlpha adjustor) {
const SkBitmap& bitmap = accessBitmap(true);
SkMatrix& matrix = data_->transform_;
@@ -286,5 +286,5 @@ void BitmapPlatformDeviceMac::processPixels(int x, int y,
}
}
-} // namespace gfx
+} // namespace skia