Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: chrome/renderer/webplugin_delegate_pepper.cc

Issue 6046009: Move base/mac_util.h to base/mac and use the base::mac namespace.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/render_process_impl.cc ('k') | chrome/test/in_process_browser_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #define PEPPER_APIS_ENABLED 1 5 #define PEPPER_APIS_ENABLED 1
6 6
7 #include "chrome/renderer/webplugin_delegate_pepper.h" 7 #include "chrome/renderer/webplugin_delegate_pepper.h"
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #if defined(OS_LINUX) 12 #if defined(OS_LINUX)
13 #include <unistd.h> 13 #include <unistd.h>
14 #endif 14 #endif
15 15
16 #include "base/file_path.h" 16 #include "base/file_path.h"
17 #include "base/file_util.h" 17 #include "base/file_util.h"
18 #if defined(OS_MACOSX) 18 #if defined(OS_MACOSX)
19 #include "base/mac_util.h" 19 #include "base/mac/mac_util.h"
20 #endif 20 #endif
21 #include "base/md5.h" 21 #include "base/md5.h"
22 #include "base/message_loop.h" 22 #include "base/message_loop.h"
23 #include "base/metrics/histogram.h" 23 #include "base/metrics/histogram.h"
24 #include "base/metrics/stats_counters.h" 24 #include "base/metrics/stats_counters.h"
25 #include "base/path_service.h" 25 #include "base/path_service.h"
26 #include "base/process_util.h" 26 #include "base/process_util.h"
27 #if defined(OS_MACOSX) 27 #if defined(OS_MACOSX)
28 #include "base/mac/scoped_cftyperef.h" 28 #include "base/mac/scoped_cftyperef.h"
29 #endif 29 #endif
(...skipping 1712 matching lines...) Expand 10 before | Expand all | Expand 10 after
1742 SkAutoLockPixels lock(bitmap); 1742 SkAutoLockPixels lock(bitmap);
1743 DCHECK(bitmap.getConfig() == SkBitmap::kARGB_8888_Config); 1743 DCHECK(bitmap.getConfig() == SkBitmap::kARGB_8888_Config);
1744 base::mac::ScopedCFTypeRef<CGDataProviderRef> data_provider( 1744 base::mac::ScopedCFTypeRef<CGDataProviderRef> data_provider(
1745 CGDataProviderCreateWithData( 1745 CGDataProviderCreateWithData(
1746 NULL, bitmap.getAddr32(0, 0), 1746 NULL, bitmap.getAddr32(0, 0),
1747 bitmap.rowBytes() * bitmap.height(), NULL)); 1747 bitmap.rowBytes() * bitmap.height(), NULL));
1748 base::mac::ScopedCFTypeRef<CGImageRef> image( 1748 base::mac::ScopedCFTypeRef<CGImageRef> image(
1749 CGImageCreate( 1749 CGImageCreate(
1750 bitmap.width(), bitmap.height(), 1750 bitmap.width(), bitmap.height(),
1751 8, 32, bitmap.rowBytes(), 1751 8, 32, bitmap.rowBytes(),
1752 mac_util::GetSystemColorSpace(), 1752 base::mac::GetSystemColorSpace(),
1753 kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host, 1753 kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host,
1754 data_provider, NULL, false, kCGRenderingIntentDefault)); 1754 data_provider, NULL, false, kCGRenderingIntentDefault));
1755 1755
1756 // Flip the transform 1756 // Flip the transform
1757 CGContextSaveGState(canvas); 1757 CGContextSaveGState(canvas);
1758 CGContextTranslateCTM(canvas, 0, canvas_height); 1758 CGContextTranslateCTM(canvas, 0, canvas_height);
1759 CGContextScaleCTM(canvas, 1.0, -1.0); 1759 CGContextScaleCTM(canvas, 1.0, -1.0);
1760 1760
1761 CGRect bounds; 1761 CGRect bounds;
1762 bounds.origin.x = dest_rect.x(); 1762 bounds.origin.x = dest_rect.x();
1763 bounds.origin.y = canvas_height - dest_rect.y() - dest_rect.height(); 1763 bounds.origin.y = canvas_height - dest_rect.y() - dest_rect.height();
1764 bounds.size.width = dest_rect.width(); 1764 bounds.size.width = dest_rect.width();
1765 bounds.size.height = dest_rect.height(); 1765 bounds.size.height = dest_rect.height();
1766 1766
1767 CGContextDrawImage(canvas, bounds, image); 1767 CGContextDrawImage(canvas, bounds, image);
1768 CGContextRestoreGState(canvas); 1768 CGContextRestoreGState(canvas);
1769 } 1769 }
1770 #endif // defined(OS_MACOSX) 1770 #endif // defined(OS_MACOSX)
OLDNEW
« no previous file with comments | « chrome/renderer/render_process_impl.cc ('k') | chrome/test/in_process_browser_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698