diff options
62 files changed, 177 insertions, 180 deletions
diff --git a/base/gfx/native_theme.cc b/base/gfx/native_theme.cc index 8c7914d..2faffd5 100644 --- a/base/gfx/native_theme.cc +++ b/base/gfx/native_theme.cc @@ -199,7 +199,7 @@ HRESULT NativeTheme::PaintScrollbarTrack(HDC hdc, int classic_state, RECT* target_rect, RECT* align_rect, - PlatformCanvasWin* canvas) const { + skia::PlatformCanvasWin* canvas) const { HANDLE handle = GetThemeHandle(SCROLLBAR); if (handle && draw_theme_) return draw_theme_(handle, hdc, part_id, state_id, target_rect, NULL); diff --git a/base/gfx/native_theme.h b/base/gfx/native_theme.h index c2a31eb..94b8848 100644 --- a/base/gfx/native_theme.h +++ b/base/gfx/native_theme.h @@ -17,8 +17,11 @@ #include "base/gfx/size.h" #include "skia/include/SkColor.h" -namespace gfx { +namespace skia { class PlatformCanvasWin; +} // namespace skia + +namespace gfx { // TODO: Define class member enums to replace part_id and state_id parameters // that are currently defined in <vssym32.h>. Afterward, classic_state should @@ -128,7 +131,7 @@ class NativeTheme { int classic_state, RECT* target_rect, RECT* align_rect, - PlatformCanvasWin* canvas) const; + skia::PlatformCanvasWin* canvas) const; // |arrow_direction| determines whether the arrow is pointing to the left or // to the right. In RTL locales, sub-menus open from right to left and diff --git a/chrome/browser/printing/printed_document.cc b/chrome/browser/printing/printed_document.cc index f6e783c..7108f83 100644 --- a/chrome/browser/printing/printed_document.cc +++ b/chrome/browser/printing/printed_document.cc @@ -103,7 +103,7 @@ void PrintedDocument::RenderPrintedPage(const PrintedPage& page, // the device context. int saved_state = SaveDC(context); DCHECK_NE(saved_state, 0); - gfx::PlatformDeviceWin::InitializeDC(context); + skia::PlatformDeviceWin::InitializeDC(context); { // Save the state (again) to apply the necessary world transformation. int saved_state = SaveDC(context); diff --git a/chrome/browser/printing/printing_layout_uitest.cc b/chrome/browser/printing/printing_layout_uitest.cc index 8a15aa4..a8c5059 100644 --- a/chrome/browser/printing/printing_layout_uitest.cc +++ b/chrome/browser/printing/printing_layout_uitest.cc @@ -172,7 +172,7 @@ class Image { &bits, NULL, 0); EXPECT_TRUE(bitmap); EXPECT_TRUE(SelectObject(hdc, bitmap)); - gfx::PlatformDeviceWin::InitializeDC(hdc); + skia::PlatformDeviceWin::InitializeDC(hdc); EXPECT_TRUE(emf.Playback(hdc, NULL)); row_length_ = size_.width() * sizeof(uint32); size_t bytes = row_length_ * size_.height(); diff --git a/chrome/browser/printing/win_printing_context.cc b/chrome/browser/printing/win_printing_context.cc index 8fb9c28..1b8b055 100644 --- a/chrome/browser/printing/win_printing_context.cc +++ b/chrome/browser/printing/win_printing_context.cc @@ -377,7 +377,7 @@ bool PrintingContext::InitializeSettings(const DEVMODE& dev_mode, const std::wstring& new_device_name, const PRINTPAGERANGE* ranges, int number_ranges) { - gfx::PlatformDeviceWin::InitializeDC(hdc_); + skia::PlatformDeviceWin::InitializeDC(hdc_); DCHECK(GetDeviceCaps(hdc_, CLIPCAPS)); DCHECK(GetDeviceCaps(hdc_, RASTERCAPS) & RC_STRETCHDIB); DCHECK(GetDeviceCaps(hdc_, RASTERCAPS) & RC_BITMAP64); diff --git a/chrome/browser/views/theme_helpers.cc b/chrome/browser/views/theme_helpers.cc index 710e1ee..ba18603 100644 --- a/chrome/browser/views/theme_helpers.cc +++ b/chrome/browser/views/theme_helpers.cc @@ -62,8 +62,8 @@ void GetRebarGradientColors(int width, int x1, int x2, SkColor* c1, SkColor* c2) // Extract the color values from the selected pixels // The | in the following operations forces the alpha to 0xFF. This is // needed as windows sets the alpha to 0 when it renders. - gfx::BitmapPlatformDeviceWin& device = - static_cast<gfx::BitmapPlatformDeviceWin&>(canvas.getTopPlatformDevice()); + skia::BitmapPlatformDeviceWin& device = + static_cast<skia::BitmapPlatformDeviceWin&>(canvas.getTopPlatformDevice()); *c1 = 0xFF000000 | device.getColorAt(x1, 0); *c2 = 0xFF000000 | device.getColorAt(x2, 0); } diff --git a/chrome/common/gfx/chrome_canvas.h b/chrome/common/gfx/chrome_canvas.h index 78b1cb1..0575b00 100644 --- a/chrome/common/gfx/chrome_canvas.h +++ b/chrome/common/gfx/chrome_canvas.h @@ -35,7 +35,7 @@ class Rect; // source and destination colors are combined. Unless otherwise specified, // the variant that does not take a SkPorterDuff::Mode uses a transfer mode // of kSrcOver_Mode. -class ChromeCanvas : public gfx::PlatformCanvas { +class ChromeCanvas : public skia::PlatformCanvas { public: // Specifies the alignment for text rendered with the DrawStringInt method. enum { @@ -182,7 +182,7 @@ class ChromeCanvas : public gfx::PlatformCanvas { }; #if defined(OS_WIN) -typedef gfx::CanvasPaintT<ChromeCanvas> ChromeCanvasPaint; +typedef skia::CanvasPaintT<ChromeCanvas> ChromeCanvasPaint; #endif #endif // CHROME_COMMON_GFX_CHROME_CANVAS_H_ diff --git a/chrome/common/gfx/chrome_canvas_skia.cc b/chrome/common/gfx/chrome_canvas_skia.cc index bbe3ca9..f68b347 100644 --- a/chrome/common/gfx/chrome_canvas_skia.cc +++ b/chrome/common/gfx/chrome_canvas_skia.cc @@ -15,10 +15,10 @@ #include "chrome/common/l10n_util.h" ChromeCanvas::ChromeCanvas(int width, int height, bool is_opaque) - : gfx::PlatformCanvasLinux(width, height, is_opaque) { + : skia::PlatformCanvasLinux(width, height, is_opaque) { } -ChromeCanvas::ChromeCanvas() : gfx::PlatformCanvasLinux() { +ChromeCanvas::ChromeCanvas() : skia::PlatformCanvasLinux() { } ChromeCanvas::~ChromeCanvas() { diff --git a/chrome/common/gfx/chrome_canvas_win.cc b/chrome/common/gfx/chrome_canvas_win.cc index 1c0442d..f28b0cb 100644 --- a/chrome/common/gfx/chrome_canvas_win.cc +++ b/chrome/common/gfx/chrome_canvas_win.cc @@ -91,10 +91,10 @@ int ComputeFormatFlags(int flags) { } // anonymous namespace ChromeCanvas::ChromeCanvas(int width, int height, bool is_opaque) - : gfx::PlatformCanvasWin(width, height, is_opaque) { + : skia::PlatformCanvasWin(width, height, is_opaque) { } -ChromeCanvas::ChromeCanvas() : gfx::PlatformCanvasWin() { +ChromeCanvas::ChromeCanvas() : skia::PlatformCanvasWin() { } ChromeCanvas::~ChromeCanvas() { diff --git a/chrome/plugin/webplugin_delegate_stub.cc b/chrome/plugin/webplugin_delegate_stub.cc index 1fc89cb..daebf40 100644 --- a/chrome/plugin/webplugin_delegate_stub.cc +++ b/chrome/plugin/webplugin_delegate_stub.cc @@ -217,7 +217,7 @@ void WebPluginDelegateStub::OnPrint(PluginMsg_PrintResponse_Params* params) { return; } HDC hdc = emf.hdc(); - gfx::PlatformDeviceWin::InitializeDC(hdc); + skia::PlatformDeviceWin::InitializeDC(hdc); delegate_->Print(hdc); if (!emf.CloseDc()) { NOTREACHED(); diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc index 7ab78629..0bd6ed8 100644 --- a/chrome/plugin/webplugin_proxy.cc +++ b/chrome/plugin/webplugin_proxy.cc @@ -355,7 +355,7 @@ void WebPluginProxy::ConvertBuffer(const base::SharedMemoryHandle& buffer, return; } - gfx::PlatformDeviceWin::InitializeDC(hdc->Get()); + skia::PlatformDeviceWin::InitializeDC(hdc->Get()); SelectObject(hdc->Get(), bitmap->Get()); } diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 87dc54e..9a06b1c 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -512,7 +512,7 @@ void RenderView::PrintPage(const ViewMsg_PrintPage_Params& params, emf.CreateDc(NULL, NULL); HDC hdc = emf.hdc(); DCHECK(hdc); - gfx::PlatformDeviceWin::InitializeDC(hdc); + skia::PlatformDeviceWin::InitializeDC(hdc); gfx::Rect rect; frame->GetPageRect(params.page_number, &rect); @@ -536,7 +536,7 @@ void RenderView::PrintPage(const ViewMsg_PrintPage_Params& params, // GDI drawing code fails. // Mix of Skia and GDI based. - gfx::PlatformCanvasWin canvas(src_size_x, src_size_y, true); + skia::PlatformCanvasWin canvas(src_size_x, src_size_y, true); canvas.drawARGB(255, 255, 255, 255, SkPorterDuff::kSrc_Mode); PlatformContextSkia context(&canvas); if (!frame->SpoolPage(params.page_number, &context)) { @@ -562,7 +562,7 @@ void RenderView::PrintPage(const ViewMsg_PrintPage_Params& params, DCHECK(retval != GDI_ERROR); #else // 100% GDI based. - gfx::VectorCanvas canvas(hdc, src_size_x, src_size_y); + skia::VectorCanvas canvas(hdc, src_size_x, src_size_y); // Set the clipping region to be sure to not overflow. SkRect clip_rect; clip_rect.set(0, 0, SkIntToScalar(src_size_x), SkIntToScalar(src_size_y)); @@ -756,7 +756,7 @@ bool RenderView::CaptureThumbnail(WebFrame* frame, double begin = time_util::GetHighResolutionTimeNow(); #endif - scoped_ptr<gfx::BitmapPlatformDevice> device; + scoped_ptr<skia::BitmapPlatformDevice> device; if (!frame->CaptureImage(&device, true)) return false; diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc index 40aee5f..c10b9e6 100644 --- a/chrome/renderer/render_widget.cc +++ b/chrome/renderer/render_widget.cc @@ -357,7 +357,7 @@ void RenderWidget::ClearFocus() { void RenderWidget::PaintRect(const gfx::Rect& rect, base::SharedMemory* paint_buf) { - gfx::PlatformCanvasWin canvas(rect.width(), rect.height(), true, + skia::PlatformCanvasWin canvas(rect.width(), rect.height(), true, paint_buf->handle()); // Bring the canvas into the coordinate system of the paint rect canvas.translate(static_cast<SkScalar>(-rect.x()), diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc index 3bad2e4f..a268edf 100644 --- a/chrome/renderer/webplugin_delegate_proxy.cc +++ b/chrome/renderer/webplugin_delegate_proxy.cc @@ -410,13 +410,13 @@ void WebPluginDelegateProxy::ResetWindowlessBitmaps() { bool WebPluginDelegateProxy::CreateBitmap( scoped_ptr<base::SharedMemory>* memory, - scoped_ptr<gfx::PlatformCanvasWin>* canvas) { + scoped_ptr<skia::PlatformCanvasWin>* canvas) { size_t size = GetPaintBufSize(plugin_rect_); scoped_ptr<base::SharedMemory> new_shared_memory(new base::SharedMemory()); if (!new_shared_memory->Create(L"", false, true, size)) return false; - scoped_ptr<gfx::PlatformCanvasWin> new_canvas(new gfx::PlatformCanvasWin); + scoped_ptr<skia::PlatformCanvasWin> new_canvas(new skia::PlatformCanvasWin); if (!new_canvas->initialize(plugin_rect_.width(), plugin_rect_.height(), true, new_shared_memory->handle())) { return false; diff --git a/chrome/renderer/webplugin_delegate_proxy.h b/chrome/renderer/webplugin_delegate_proxy.h index 392682c..38e65e6 100644 --- a/chrome/renderer/webplugin_delegate_proxy.h +++ b/chrome/renderer/webplugin_delegate_proxy.h @@ -22,11 +22,11 @@ class GURL; struct PluginHostMsg_RouteToFrame_Params; class RenderView; class SkBitmap; -namespace gfx { + +namespace skia { class PlatformCanvasWin; } - // An implementation of WebPluginDelegate that proxies all calls to // the plugin process. class WebPluginDelegateProxy : public WebPluginDelegate, @@ -145,7 +145,7 @@ class WebPluginDelegateProxy : public WebPluginDelegate, // Creates a shared memory section and canvas. bool CreateBitmap(scoped_ptr<base::SharedMemory>* memory, - scoped_ptr<gfx::PlatformCanvasWin>* canvas); + scoped_ptr<skia::PlatformCanvasWin>* canvas); RenderView* render_view_; WebPlugin* plugin_; @@ -182,11 +182,11 @@ class WebPluginDelegateProxy : public WebPluginDelegate, // for transparent plugins, as they need the backgroud data during painting. bool transparent_; scoped_ptr<base::SharedMemory> backing_store_; - scoped_ptr<gfx::PlatformCanvasWin> backing_store_canvas_; + scoped_ptr<skia::PlatformCanvasWin> backing_store_canvas_; scoped_ptr<base::SharedMemory> transport_store_; - scoped_ptr<gfx::PlatformCanvasWin> transport_store_canvas_; + scoped_ptr<skia::PlatformCanvasWin> transport_store_canvas_; scoped_ptr<base::SharedMemory> background_store_; - scoped_ptr<gfx::PlatformCanvasWin> background_store_canvas_; + scoped_ptr<skia::PlatformCanvasWin> background_store_canvas_; // This lets us know which portion of the backing store has been painted into. gfx::Rect backing_store_painted_; diff --git a/skia/ext/bitmap_platform_device.h b/skia/ext/bitmap_platform_device.h index d33ae73..fcc8644c 100644 --- a/skia/ext/bitmap_platform_device.h +++ b/skia/ext/bitmap_platform_device.h @@ -8,23 +8,20 @@ #if defined(WIN32) #include "skia/ext/bitmap_platform_device_win.h" -namespace gfx { - -typedef BitmapPlatformDeviceWin BitmapPlatformDevice; - -} // namespace gfx #elif defined(__APPLE__) #include "skia/ext/bitmap_platform_device_mac.h" -namespace gfx { - -typedef BitmapPlatformDeviceMac BitmapPlatformDevice; - -} // namespace gfx #elif defined(__linux__) #include "skia/ext/bitmap_platform_device_linux.h" -namespace gfx { +#endif -typedef BitmapPlatformDeviceLinux BitmapPlatformDevice; +namespace skia { -} // namespace gfx +#if defined(WIN32) +typedef BitmapPlatformDeviceWin BitmapPlatformDevice; +#elif defined(__APPLE__) +typedef BitmapPlatformDeviceMac BitmapPlatformDevice; +#elif defined(__linux__) +typedef BitmapPlatformDeviceLinux BitmapPlatformDevice; #endif + +} // namespace skia diff --git a/skia/ext/bitmap_platform_device_linux.cc b/skia/ext/bitmap_platform_device_linux.cc index 4dd322d..4e4615f 100644 --- a/skia/ext/bitmap_platform_device_linux.cc +++ b/skia/ext/bitmap_platform_device_linux.cc @@ -8,7 +8,7 @@ #include "base/logging.h" -namespace gfx { +namespace skia { // ----------------------------------------------------------------------------- // These objects are reference counted and own a Cairo surface. The surface is @@ -91,4 +91,4 @@ BitmapPlatformDeviceLinux& BitmapPlatformDeviceLinux::operator=( return *this; } -} // namespace gfx +} // namespace skia diff --git a/skia/ext/bitmap_platform_device_linux.h b/skia/ext/bitmap_platform_device_linux.h index 14e4c0c..b4f0c1bc 100644 --- a/skia/ext/bitmap_platform_device_linux.h +++ b/skia/ext/bitmap_platform_device_linux.h @@ -40,7 +40,7 @@ typedef struct _cairo_surface cairo_surface_t; // something that we can't easily change. // ----------------------------------------------------------------------------- -namespace gfx { +namespace skia { // ----------------------------------------------------------------------------- // This is the Linux bitmap backing for Skia. We create a Cairo image surface @@ -86,6 +86,6 @@ class BitmapPlatformDeviceLinux : public PlatformDeviceLinux { scoped_refptr<BitmapPlatformDeviceLinuxData> data_; }; -} // namespace gfx +} // namespace skia #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_LINUX_H_ 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 diff --git a/skia/ext/bitmap_platform_device_mac.h b/skia/ext/bitmap_platform_device_mac.h index db798eb..01176aa 100755 --- a/skia/ext/bitmap_platform_device_mac.h +++ b/skia/ext/bitmap_platform_device_mac.h @@ -8,7 +8,7 @@ #include "base/ref_counted.h" #include "skia/ext/platform_device_mac.h" -namespace gfx { +namespace skia { // A device is basically a wrapper around SkBitmap that provides a surface for // SkCanvas to draw into. Our device provides a surface CoreGraphics can also @@ -85,11 +85,11 @@ class BitmapPlatformDeviceMac : public PlatformDeviceMac { scoped_refptr<BitmapPlatformDeviceMacData> data_; virtual void processPixels(int x, int y, - int width, int height, + int width, int height, adjustAlpha adjustor); }; -} // namespace gfx +} // namespace skia #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_MAC_H_ diff --git a/skia/ext/bitmap_platform_device_win.cc b/skia/ext/bitmap_platform_device_win.cc index 63efc8f..674a6d9 100644 --- a/skia/ext/bitmap_platform_device_win.cc +++ b/skia/ext/bitmap_platform_device_win.cc @@ -10,7 +10,7 @@ #include "SkRegion.h" #include "SkUtils.h" -namespace gfx { +namespace skia { // When Windows draws text, is sets the fourth byte (which Skia uses for alpha) // to zero. This means that if we try compositing with text that Windows has @@ -242,7 +242,7 @@ BitmapPlatformDeviceWin* BitmapPlatformDeviceWin::create(HDC screen_dc, } BITMAPINFOHEADER hdr = {0}; - CreateBitmapHeader(width, height, &hdr); + gfx::CreateBitmapHeader(width, height, &hdr); void* data = NULL; HBITMAP hbitmap = CreateDIBSection(screen_dc, @@ -442,5 +442,5 @@ void BitmapPlatformDeviceWin::processPixels(int x, } } -} // namespace gfx +} // namespace skia diff --git a/skia/ext/bitmap_platform_device_win.h b/skia/ext/bitmap_platform_device_win.h index e392306ea..e3b63cb 100644 --- a/skia/ext/bitmap_platform_device_win.h +++ b/skia/ext/bitmap_platform_device_win.h @@ -8,7 +8,7 @@ #include "base/ref_counted.h" #include "skia/ext/platform_device_win.h" -namespace gfx { +namespace skia { // A device is basically a wrapper around SkBitmap that provides a surface for // SkCanvas to draw into. Our device provides a surface Windows can also write @@ -105,7 +105,7 @@ class BitmapPlatformDeviceWin : public PlatformDeviceWin { scoped_refptr<BitmapPlatformDeviceWinData> data_; }; -} // namespace gfx +} // namespace skia #endif // SKIA_BITMAP_PLATFORM_DEVICE_WIN_H_ diff --git a/skia/ext/convolver_unittest.cc b/skia/ext/convolver_unittest.cc index f93b2e5..10db76c 100644 --- a/skia/ext/convolver_unittest.cc +++ b/skia/ext/convolver_unittest.cc @@ -123,5 +123,5 @@ TEST(Convolver, Halve) { } } -} // namespace gfx +} // namespace skia diff --git a/skia/ext/platform_canvas.h b/skia/ext/platform_canvas.h index b1e4310..e0883e3 100644 --- a/skia/ext/platform_canvas.h +++ b/skia/ext/platform_canvas.h @@ -8,23 +8,20 @@ #if defined(WIN32) #include "skia/ext/platform_canvas_win.h" -namespace gfx { - -typedef PlatformCanvasWin PlatformCanvas; - -} // namespace gfx #elif defined(__APPLE__) #include "skia/ext/platform_canvas_mac.h" -namespace gfx { - -typedef PlatformCanvasMac PlatformCanvas; - -} // namespace gfx #elif defined(__linux__) #include "skia/ext/platform_canvas_linux.h" -namespace gfx { +#endif -typedef PlatformCanvasLinux PlatformCanvas; +namespace skia { -} // namespace gfx +#if defined(WIN32) +typedef PlatformCanvasWin PlatformCanvas; +#elif defined(__APPLE__) +typedef PlatformCanvasMac PlatformCanvas; +#elif defined(__linux__) +typedef PlatformCanvasLinux PlatformCanvas; #endif + +} // namespace skia diff --git a/skia/ext/platform_canvas_linux.cc b/skia/ext/platform_canvas_linux.cc index ba2fe81..578575a 100644 --- a/skia/ext/platform_canvas_linux.cc +++ b/skia/ext/platform_canvas_linux.cc @@ -8,7 +8,7 @@ #include "skia/ext/platform_device_linux.h" #include "skia/ext/bitmap_platform_device_linux.h" -namespace gfx { +namespace skia { PlatformCanvasLinux::PlatformCanvasLinux() : SkCanvas() { } @@ -52,4 +52,4 @@ SkDevice* PlatformCanvasLinux::createPlatformDevice(int width, return BitmapPlatformDeviceLinux::Create(width, height, is_opaque); } -} // namespace gfx +} // namespace skia diff --git a/skia/ext/platform_canvas_linux.h b/skia/ext/platform_canvas_linux.h index 93919c6..1a5afe7 100644 --- a/skia/ext/platform_canvas_linux.h +++ b/skia/ext/platform_canvas_linux.h @@ -7,7 +7,7 @@ #include "skia/ext/platform_device_linux.h" -namespace gfx { +namespace skia { // This class is a specialization of the regular SkCanvas that is designed to // work with a gfx::PlatformDevice to manage platform-specific drawing. It @@ -47,6 +47,6 @@ class PlatformCanvasLinux : public SkCanvas { PlatformCanvasLinux& operator=(const PlatformCanvasLinux&); }; -} // namespace gfx +} // namespace skia #endif // SKIA_EXT_PLATFORM_CANVAS_LINUX_H_ diff --git a/skia/ext/platform_canvas_mac.cc b/skia/ext/platform_canvas_mac.cc index 0bb56f4..5b5845c 100755 --- a/skia/ext/platform_canvas_mac.cc +++ b/skia/ext/platform_canvas_mac.cc @@ -7,7 +7,7 @@ #include "base/logging.h" #include "skia/ext/bitmap_platform_device_mac.h" -namespace gfx { +namespace skia { PlatformCanvasMac::PlatformCanvasMac() : SkCanvas() { } @@ -76,5 +76,5 @@ SkDevice* PlatformCanvasMac::setBitmapDevice(const SkBitmap&) { return NULL; } -} // namespace gfx +} // namespace skia diff --git a/skia/ext/platform_canvas_mac.h b/skia/ext/platform_canvas_mac.h index 3f43fb2..adcdb86 100755 --- a/skia/ext/platform_canvas_mac.h +++ b/skia/ext/platform_canvas_mac.h @@ -9,7 +9,7 @@ #include "SkCanvas.h" -namespace gfx { +namespace skia { // This class is a specialization of the regular SkCanvas that is designed to // work with a gfx::PlatformDevice to manage platform-specific drawing. It @@ -82,7 +82,7 @@ class PlatformCanvasMac : public SkCanvas { PlatformCanvasMac& operator=(const PlatformCanvasMac&); }; -} // namespace gfx +} // namespace skia #endif // SKIA_EXT_PLATFORM_CANVAS_MAC_H_ diff --git a/skia/ext/platform_canvas_unittest.cc b/skia/ext/platform_canvas_unittest.cc index a59ef1c..d382477 100644 --- a/skia/ext/platform_canvas_unittest.cc +++ b/skia/ext/platform_canvas_unittest.cc @@ -18,7 +18,7 @@ #include "SkColor.h" -namespace gfx { +namespace skia { namespace { @@ -292,5 +292,5 @@ TEST(PlatformCanvas, TranslateLayer) { kInnerW, kInnerH)); } -} // namespace +} // namespace skia diff --git a/skia/ext/platform_canvas_win.cc b/skia/ext/platform_canvas_win.cc index e3dffeb7..4062d7b 100644 --- a/skia/ext/platform_canvas_win.cc +++ b/skia/ext/platform_canvas_win.cc @@ -8,7 +8,7 @@ #include "base/process_util.h" #include "skia/ext/bitmap_platform_device_win.h" -namespace gfx { +namespace skia { // Crashes the process. This is called when a bitmap allocation fails, and this // function tries to determine why it might have failed, and crash on different @@ -114,4 +114,4 @@ SkDevice* PlatformCanvasWin::setBitmapDevice(const SkBitmap&) { return NULL; } -} // namespace gfx +} // namespace skia diff --git a/skia/ext/platform_canvas_win.h b/skia/ext/platform_canvas_win.h index c3f42a3..c16fa33 100644 --- a/skia/ext/platform_canvas_win.h +++ b/skia/ext/platform_canvas_win.h @@ -12,11 +12,11 @@ #include "SkCanvas.h" -namespace gfx { +namespace skia { // This class is a specialization of the regular SkCanvas that is designed to -// work with a gfx::PlatformDevice to manage platform-specific drawing. It -// allows using both Skia operations and platform-specific operations. +// work with a PlatformDevice to manage platform-specific drawing. It allows +// using both Skia operations and platform-specific operations. class PlatformCanvasWin : public SkCanvas { public: // Set is_opaque if you are going to erase the bitmap and not use @@ -196,7 +196,7 @@ class CanvasPaintT : public T { typedef CanvasPaintT<PlatformCanvasWin> PlatformCanvasWinPaint; -} // namespace gfx +} // namespace skia #endif // SKIA_EXT_PLATFORM_CANVAS_WIN_H_ diff --git a/skia/ext/platform_device.h b/skia/ext/platform_device.h index 811dfa6..413a47f 100644 --- a/skia/ext/platform_device.h +++ b/skia/ext/platform_device.h @@ -14,7 +14,7 @@ #include "skia/ext/platform_device_linux.h" #endif -namespace gfx { +namespace skia { #if defined(WIN32) typedef PlatformDeviceWin PlatformDevice; @@ -24,4 +24,4 @@ typedef PlatformDeviceMac PlatformDevice; typedef PlatformDeviceLinux PlatformDevice; #endif -} // namespace gfx +} // namespace skia diff --git a/skia/ext/platform_device_linux.cc b/skia/ext/platform_device_linux.cc index f148ed1..e8d12ec 100644 --- a/skia/ext/platform_device_linux.cc +++ b/skia/ext/platform_device_linux.cc @@ -4,10 +4,10 @@ #include "skia/ext/platform_device_linux.h" -namespace gfx { +namespace skia { PlatformDeviceLinux::PlatformDeviceLinux(const SkBitmap& bitmap) : SkDevice(bitmap) { } -} // namespace gfx +} // namespace skia diff --git a/skia/ext/platform_device_linux.h b/skia/ext/platform_device_linux.h index 185baf0..5c16c08 100644 --- a/skia/ext/platform_device_linux.h +++ b/skia/ext/platform_device_linux.h @@ -7,7 +7,7 @@ #include "SkDevice.h" -namespace gfx { +namespace skia { // Blindly copying the mac hierarchy. class PlatformDeviceLinux : public SkDevice { @@ -20,6 +20,6 @@ class PlatformDeviceLinux : public SkDevice { PlatformDeviceLinux(const SkBitmap& bitmap); }; -} // namespace gfx +} // namespace skia #endif // SKIA_EXT_PLATFORM_DEVICE_LINUX_H_ diff --git a/skia/ext/platform_device_mac.cc b/skia/ext/platform_device_mac.cc index 3cc6fb4..58c775d 100755 --- a/skia/ext/platform_device_mac.cc +++ b/skia/ext/platform_device_mac.cc @@ -10,7 +10,10 @@ #include "SkPath.h" #include "SkUtils.h" -namespace gfx { +namespace skia { + +// TODO(brettw) remove this when the gfx namespaces are all removed. +using namespace gfx; namespace { @@ -157,5 +160,5 @@ void PlatformDeviceMac::LoadClippingRegionToCGContext( } } -} // namespace gfx +} // namespace skia diff --git a/skia/ext/platform_device_mac.h b/skia/ext/platform_device_mac.h index 589448c..dbfed5c 100755 --- a/skia/ext/platform_device_mac.h +++ b/skia/ext/platform_device_mac.h @@ -12,7 +12,7 @@ class SkMatrix; class SkPath; class SkRegion; -namespace gfx { +namespace skia { // A device is basically a wrapper around SkBitmap that provides a surface for // SkCanvas to draw into. Our device provides a surface CoreGraphics can also @@ -80,7 +80,7 @@ class PlatformDeviceMac : public SkDevice { adjustAlpha adjustor) = 0; }; -} // namespace gfx +} // namespace skia #endif // SKIA_EXT_PLATFORM_DEVICE_MAC_H_ diff --git a/skia/ext/platform_device_win.cc b/skia/ext/platform_device_win.cc index 5a94efa..905e9bf 100644 --- a/skia/ext/platform_device_win.cc +++ b/skia/ext/platform_device_win.cc @@ -11,10 +11,7 @@ #include "SkRegion.h" #include "SkUtils.h" -namespace gfx { - -// TODO(brettw) remove this when this file is moved into the Skia namespace. -using namespace skia; +namespace skia { PlatformDeviceWin::PlatformDeviceWin(const SkBitmap& bitmap) : SkDevice(bitmap) { @@ -228,5 +225,5 @@ void PlatformDeviceWin::LoadClippingRegionToDC(HDC context, DCHECK_NE(result, 0); } -} // namespace gfx +} // namespace skia diff --git a/skia/ext/platform_device_win.h b/skia/ext/platform_device_win.h index e01a2c5..506bd6a 100644 --- a/skia/ext/platform_device_win.h +++ b/skia/ext/platform_device_win.h @@ -15,7 +15,7 @@ class SkMatrix; class SkPath; class SkRegion; -namespace gfx { +namespace skia { // A device is basically a wrapper around SkBitmap that provides a surface for // SkCanvas to draw into. Our device provides a surface Windows can also write @@ -92,7 +92,7 @@ class PlatformDeviceWin : public SkDevice { static bool SkPathToCubicPaths(CubicPaths* paths, const SkPath& skpath); }; -} // namespace gfx +} // namespace skia #endif // SKIA_EXT_PLATFORM_DEVICE_WIN_H_ diff --git a/skia/ext/vector_canvas.cc b/skia/ext/vector_canvas.cc index a671852..33ac265 100644 --- a/skia/ext/vector_canvas.cc +++ b/skia/ext/vector_canvas.cc @@ -7,7 +7,7 @@ #include "base/logging.h" #include "skia/ext/vector_device.h" -namespace gfx { +namespace skia { VectorCanvas::VectorCanvas() { } @@ -86,5 +86,5 @@ bool VectorCanvas::IsTopDeviceVectorial() const { return getTopPlatformDevice().IsVectorial(); } -} // namespace gfx +} // namespace skia diff --git a/skia/ext/vector_canvas.h b/skia/ext/vector_canvas.h index 66a45eb..6b61b58 100644 --- a/skia/ext/vector_canvas.h +++ b/skia/ext/vector_canvas.h @@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef BASE_GFX_VECTOR_CANVAS_H_ -#define BASE_GFX_VECTOR_CANVAS_H_ +#ifndef SKIA_EXT_VECTOR_CANVAS_H_ +#define SKIA_EXT_VECTOR_CANVAS_H_ #include "skia/ext/platform_canvas_win.h" #include "skia/ext/vector_device.h" -namespace gfx { +namespace skia { // This class is a specialization of the regular PlatformCanvas. It is designed // to work with a VectorDevice to manage platform-specific drawing. It allows @@ -40,7 +40,7 @@ class VectorCanvas : public PlatformCanvasWin { DISALLOW_COPY_AND_ASSIGN(VectorCanvas); }; -} // namespace gfx +} // namespace skia -#endif // BASE_GFX_VECTOR_CANVAS_H_ +#endif // SKIA_EXT_VECTOR_CANVAS_H_ diff --git a/skia/ext/vector_canvas_unittest.cc b/skia/ext/vector_canvas_unittest.cc index b50c230..03e920f 100644 --- a/skia/ext/vector_canvas_unittest.cc +++ b/skia/ext/vector_canvas_unittest.cc @@ -19,6 +19,8 @@ #include "SkDashPathEffect.h" +namespace skia { + namespace { const wchar_t* const kGenerateSwitch = L"vector-canvas-generate"; @@ -138,7 +140,7 @@ class Image { } // Loads the image from a canvas. - Image(const gfx::PlatformCanvasWin& canvas) : ignore_alpha_(true) { + Image(const skia::PlatformCanvasWin& canvas) : ignore_alpha_(true) { // Use a different way to access the bitmap. The normal way would be to // query the SkBitmap. HDC context = canvas.getTopPlatformDevice().getBitmapDC(); @@ -277,7 +279,7 @@ class ImageTest : public DataUnitTest { // kGenerating value. Returns 0 on success or any positive value between ]0, // 100] on failure. The return value is the percentage of difference between // the image in the file and the image in the canvas. - double ProcessCanvas(const gfx::PlatformCanvasWin& canvas, + double ProcessCanvas(const skia::PlatformCanvasWin& canvas, std::wstring filename) const { filename += L".png"; switch (action_) { @@ -296,8 +298,8 @@ class ImageTest : public DataUnitTest { // Compares the bitmap currently loaded in the context with the file. Returns // the percentage of pixel difference between both images, between 0 and 100. - double CompareImage(const gfx::PlatformCanvasWin& canvas, - const std::wstring& filename) const { + double CompareImage(const skia::PlatformCanvasWin& canvas, + const std::wstring& filename) const { Image image1(canvas); Image image2(test_file(filename)); double diff = image1.PercentageDifferent(image2); @@ -305,7 +307,7 @@ class ImageTest : public DataUnitTest { } // Saves the bitmap currently loaded in the context into the file. - void SaveImage(const gfx::PlatformCanvasWin& canvas, + void SaveImage(const skia::PlatformCanvasWin& canvas, const std::wstring& filename) const { Image(canvas).SaveToFile(test_file(filename)); } @@ -395,8 +397,8 @@ class VectorCanvasTest : public ImageTest { size_ = size; context_ = new Context(); bitmap_ = new Bitmap(*context_, size_, size_); - vcanvas_ = new gfx::VectorCanvas(context_->context(), size_, size_); - pcanvas_ = new gfx::PlatformCanvasWin(size_, size_, false); + vcanvas_ = new VectorCanvas(context_->context(), size_, size_); + pcanvas_ = new PlatformCanvasWin(size_, size_, false); // Clear white. vcanvas_->drawARGB(255, 255, 255, 255, SkPorterDuff::kSrc_Mode); @@ -437,10 +439,10 @@ class VectorCanvasTest : public ImageTest { Bitmap* bitmap_; // Vector based canvas. - gfx::VectorCanvas* vcanvas_; + VectorCanvas* vcanvas_; // Pixel based canvas. - gfx::PlatformCanvasWin* pcanvas_; + PlatformCanvasWin* pcanvas_; // When true (default), vcanvas_ and pcanvas_ contents are compared and // verified to be identical. @@ -460,8 +462,8 @@ TEST_F(VectorCanvasTest, Uninitialized) { context_ = new Context(); bitmap_ = new Bitmap(*context_, size_, size_); - vcanvas_ = new gfx::VectorCanvas(context_->context(), size_, size_); - pcanvas_ = new gfx::PlatformCanvasWin(size_, size_, false); + vcanvas_ = new VectorCanvas(context_->context(), size_, size_); + pcanvas_ = new PlatformCanvasWin(size_, size_, false); // VectorCanvas default initialization is black. // PlatformCanvas default initialization is almost white 0x01FFFEFD (invalid @@ -1007,3 +1009,4 @@ TEST_F(VectorCanvasTest, Matrix) { } } +} // namespace skia diff --git a/skia/ext/vector_device.cc b/skia/ext/vector_device.cc index bf52462..98aaeff 100644 --- a/skia/ext/vector_device.cc +++ b/skia/ext/vector_device.cc @@ -11,10 +11,7 @@ #include "SkUtils.h" -namespace gfx { - -// TODO(brettw) remove this when all the namespaces are moved to skia. -using namespace skia; +namespace skia { VectorDevice* VectorDevice::create(HDC dc, int width, int height) { InitializeDC(dc); @@ -611,5 +608,5 @@ void VectorDevice::InternalDrawBitmap(const SkBitmap& bitmap, int x, int y, Cleanup(); } -} // namespace gfx +} // namespace skia diff --git a/skia/ext/vector_device.h b/skia/ext/vector_device.h index b4f3336..5fdb9a0 100644 --- a/skia/ext/vector_device.h +++ b/skia/ext/vector_device.h @@ -10,7 +10,7 @@ #include "SkMatrix.h" #include "SkRegion.h" -namespace gfx { +namespace skia { // A device is basically a wrapper around SkBitmap that provides a surface for // SkCanvas to draw into. This specific device is not not backed by a surface @@ -113,7 +113,7 @@ class VectorDevice : public PlatformDeviceWin { DISALLOW_COPY_AND_ASSIGN(VectorDevice); }; -} // namespace gfx +} // namespace skia #endif // VectorDevice_h diff --git a/webkit/glue/webframe.h b/webkit/glue/webframe.h index 6235586..f865b0f 100644 --- a/webkit/glue/webframe.h +++ b/webkit/glue/webframe.h @@ -298,7 +298,7 @@ class WebFrame : public base::RefCounted<WebFrame> { // // Returns false on failure. CaptureImage can fail if 'image' argument // is not valid or due to failure to allocate a canvas. - virtual bool CaptureImage(scoped_ptr<gfx::BitmapPlatformDevice>* image, + virtual bool CaptureImage(scoped_ptr<skia::BitmapPlatformDevice>* image, bool scroll_to_zero) = 0; // This function sets a flag within WebKit to instruct it to render the page @@ -358,7 +358,7 @@ class WebFrame : public base::RefCounted<WebFrame> { virtual void GetPageRect(int page, gfx::Rect* page_size) const = 0; // Prints one page. |page| is 0-based. - virtual bool SpoolPage(int page, gfx::PlatformCanvas* canvas) = 0; + virtual bool SpoolPage(int page, skia::PlatformCanvas* canvas) = 0; // Is this frame reloading with allowing stale data? This will be true when // the encoding of the page is changed and it needs to be re-interpreted, diff --git a/webkit/glue/webframe_impl.cc b/webkit/glue/webframe_impl.cc index 40a2842..dbcca01 100644 --- a/webkit/glue/webframe_impl.cc +++ b/webkit/glue/webframe_impl.cc @@ -1421,7 +1421,7 @@ void WebFrameImpl::Layout() { FromFrame(child)->Layout(); } -void WebFrameImpl::Paint(gfx::PlatformCanvas* canvas, const gfx::Rect& rect) { +void WebFrameImpl::Paint(skia::PlatformCanvas* canvas, const gfx::Rect& rect) { static StatsRate rendering("WebFramePaintTime"); StatsScope<StatsRate> rendering_scope(rendering); @@ -1444,7 +1444,7 @@ void WebFrameImpl::Paint(gfx::PlatformCanvas* canvas, const gfx::Rect& rect) { } } -bool WebFrameImpl::CaptureImage(scoped_ptr<gfx::BitmapPlatformDevice>* image, +bool WebFrameImpl::CaptureImage(scoped_ptr<skia::BitmapPlatformDevice>* image, bool scroll_to_zero) { if (!image) { NOTREACHED(); @@ -1454,7 +1454,7 @@ bool WebFrameImpl::CaptureImage(scoped_ptr<gfx::BitmapPlatformDevice>* image, // Must layout before painting. Layout(); - gfx::PlatformCanvas canvas; + skia::PlatformCanvas canvas; if (!canvas.initialize(frameview()->width(), frameview()->height(), true)) return false; @@ -1471,14 +1471,14 @@ bool WebFrameImpl::CaptureImage(scoped_ptr<gfx::BitmapPlatformDevice>* image, canvas.endPlatformPaint(); #endif - gfx::BitmapPlatformDevice& device = - static_cast<gfx::BitmapPlatformDevice&>(canvas.getTopPlatformDevice()); + skia::BitmapPlatformDevice& device = + static_cast<skia::BitmapPlatformDevice&>(canvas.getTopPlatformDevice()); #if defined(OS_WIN) device.fixupAlphaBeforeCompositing(); #endif - image->reset(new gfx::BitmapPlatformDevice(device)); + image->reset(new skia::BitmapPlatformDevice(device)); return true; } @@ -1781,7 +1781,7 @@ void WebFrameImpl::GetPageRect(int page, gfx::Rect* page_size) const { *page_size = webkit_glue::FromIntRect(pages_[page]); } -bool WebFrameImpl::SpoolPage(int page, gfx::PlatformCanvas* canvas) { +bool WebFrameImpl::SpoolPage(int page, skia::PlatformCanvas* canvas) { // Ensure correct state. if (!printing_ || page < 0 || diff --git a/webkit/glue/webframe_impl.h b/webkit/glue/webframe_impl.h index 7530170..b7d6753 100644 --- a/webkit/glue/webframe_impl.h +++ b/webkit/glue/webframe_impl.h @@ -110,7 +110,7 @@ class WebFrameImpl : public WebFrame { virtual WebFrame* GetParent() const; virtual WebFrame* GetChildFrame(const std::wstring& xpath) const; virtual WebView* GetView() const; - virtual bool CaptureImage(scoped_ptr<gfx::BitmapPlatformDevice>* image, + virtual bool CaptureImage(scoped_ptr<skia::BitmapPlatformDevice>* image, bool scroll_to_zero); // This method calls createRuntimeObject (in KJS::Bindings::Instance), which @@ -170,7 +170,7 @@ class WebFrameImpl : public WebFrame { int* width); virtual int ComputePageRects(const gfx::Size& page_size_px); virtual void GetPageRect(int page, gfx::Rect* page_size) const; - virtual bool SpoolPage(int page, gfx::PlatformCanvas* canvas); + virtual bool SpoolPage(int page, skia::PlatformCanvas* canvas); // Reformats this frame for printing or for screen display, depending on // |printing| flag. Acts recursively on inner frames. @@ -184,7 +184,7 @@ class WebFrameImpl : public WebFrame { // WebFrameImpl void Layout(); - void Paint(gfx::PlatformCanvas* canvas, const gfx::Rect& rect); + void Paint(skia::PlatformCanvas* canvas, const gfx::Rect& rect); bool IsLoading(); diff --git a/webkit/glue/webview_impl.cc b/webkit/glue/webview_impl.cc index 540b654..d4d19fb 100644 --- a/webkit/glue/webview_impl.cc +++ b/webkit/glue/webview_impl.cc @@ -846,7 +846,7 @@ void WebViewImpl::Layout() { } } -void WebViewImpl::Paint(gfx::PlatformCanvas* canvas, const gfx::Rect& rect) { +void WebViewImpl::Paint(skia::PlatformCanvas* canvas, const gfx::Rect& rect) { WebFrameImpl* webframe = main_frame(); if (webframe) webframe->Paint(canvas, rect); diff --git a/webkit/glue/webview_impl.h b/webkit/glue/webview_impl.h index e0f693e..5c0a554 100644 --- a/webkit/glue/webview_impl.h +++ b/webkit/glue/webview_impl.h @@ -61,7 +61,7 @@ class WebViewImpl : public WebView { virtual void Resize(const gfx::Size& new_size); virtual gfx::Size GetSize() { return size(); } virtual void Layout(); - virtual void Paint(gfx::PlatformCanvas* canvas, const gfx::Rect& rect); + virtual void Paint(skia::PlatformCanvas* canvas, const gfx::Rect& rect); virtual bool HandleInputEvent(const WebInputEvent* input_event); virtual void MouseCaptureLost(); virtual void SetFocus(bool enable); diff --git a/webkit/glue/webwidget.h b/webkit/glue/webwidget.h index 9995cc2..9d26fb5 100644 --- a/webkit/glue/webwidget.h +++ b/webkit/glue/webwidget.h @@ -45,7 +45,7 @@ class WebWidget : public base::RefCounted<WebWidget> { // multiple times once Layout has been called, assuming no other changes are // made to the WebWidget (e.g., once events are processed, it should be assumed // that another call to Layout is warranted before painting again). - virtual void Paint(gfx::PlatformCanvas* canvas, const gfx::Rect& rect) = 0; + virtual void Paint(skia::PlatformCanvas* canvas, const gfx::Rect& rect) = 0; // Called to inform the WebWidget of an input event. // Returns true if the event has been processed, false otherwise. diff --git a/webkit/glue/webwidget_impl.cc b/webkit/glue/webwidget_impl.cc index dfd86d9..55f6d7c 100644 --- a/webkit/glue/webwidget_impl.cc +++ b/webkit/glue/webwidget_impl.cc @@ -121,7 +121,7 @@ void WebWidgetImpl::Resize(const gfx::Size& new_size) { void WebWidgetImpl::Layout() { } -void WebWidgetImpl::Paint(gfx::PlatformCanvas* canvas, const gfx::Rect& rect) { +void WebWidgetImpl::Paint(skia::PlatformCanvas* canvas, const gfx::Rect& rect) { if (!widget_) return; diff --git a/webkit/glue/webwidget_impl.h b/webkit/glue/webwidget_impl.h index 97b08a2..246709b9 100644 --- a/webkit/glue/webwidget_impl.h +++ b/webkit/glue/webwidget_impl.h @@ -37,7 +37,7 @@ class WebWidgetImpl : public WebWidget, virtual void Resize(const gfx::Size& new_size); virtual gfx::Size GetSize() { return size(); } virtual void Layout(); - virtual void Paint(gfx::PlatformCanvas* canvas, const gfx::Rect& rect); + virtual void Paint(skia::PlatformCanvas* canvas, const gfx::Rect& rect); virtual bool HandleInputEvent(const WebInputEvent* input_event); virtual void MouseCaptureLost(); virtual void SetFocus(bool enable); diff --git a/webkit/port/platform/chromium/ScrollbarThemeChromiumWin.cpp b/webkit/port/platform/chromium/ScrollbarThemeChromiumWin.cpp index 0246501..d7c0daa 100644 --- a/webkit/port/platform/chromium/ScrollbarThemeChromiumWin.cpp +++ b/webkit/port/platform/chromium/ScrollbarThemeChromiumWin.cpp @@ -80,7 +80,7 @@ void ScrollbarThemeChromium::paintTrackPiece(GraphicsContext* gc, Scrollbar* scr { bool horz = scrollbar->orientation() == HorizontalScrollbar; - gfx::PlatformCanvasWin* canvas = gc->platformContext()->canvas(); + skia::PlatformCanvasWin* canvas = gc->platformContext()->canvas(); HDC hdc = canvas->beginPlatformPaint(); RECT paintRect = toRECT(rect); @@ -111,7 +111,7 @@ void ScrollbarThemeChromium::paintButton(GraphicsContext* gc, Scrollbar* scrollb { bool horz = scrollbar->orientation() == HorizontalScrollbar; - gfx::PlatformCanvasWin* canvas = gc->platformContext()->canvas(); + skia::PlatformCanvasWin* canvas = gc->platformContext()->canvas(); HDC hdc = canvas->beginPlatformPaint(); RECT paintRect = toRECT(rect); @@ -137,7 +137,7 @@ void ScrollbarThemeChromium::paintThumb(GraphicsContext* gc, Scrollbar* scrollba { bool horz = scrollbar->orientation() == HorizontalScrollbar; - gfx::PlatformCanvasWin* canvas = gc->platformContext()->canvas(); + skia::PlatformCanvasWin* canvas = gc->platformContext()->canvas(); HDC hdc = canvas->beginPlatformPaint(); RECT paintRect = toRECT(rect); diff --git a/webkit/port/platform/graphics/chromium/ImageBufferData.h b/webkit/port/platform/graphics/chromium/ImageBufferData.h index 9b46294..f8d3fd3 100644 --- a/webkit/port/platform/graphics/chromium/ImageBufferData.h +++ b/webkit/port/platform/graphics/chromium/ImageBufferData.h @@ -43,7 +43,7 @@ class ImageBufferData { public: ImageBufferData(const IntSize&); - gfx::PlatformCanvas m_canvas; + skia::PlatformCanvas m_canvas; // Must be second since this will refer to m_canvas. PlatformContextSkia m_platformContext; diff --git a/webkit/port/platform/graphics/skia/ImageSkia.cpp b/webkit/port/platform/graphics/skia/ImageSkia.cpp index 6314699..972ca0d 100644 --- a/webkit/port/platform/graphics/skia/ImageSkia.cpp +++ b/webkit/port/platform/graphics/skia/ImageSkia.cpp @@ -245,7 +245,7 @@ void paintSkBitmap(PlatformContextSkia* platformContext, SkPaint paint; paint.setPorterDuffXfermode(compOp); - gfx::PlatformCanvas* canvas = platformContext->canvas(); + skia::PlatformCanvas* canvas = platformContext->canvas(); ResamplingMode resampling = platformContext->IsPrinting() ? RESAMPLE_NONE : computeResamplingMode(bitmap, srcRect.width(), srcRect.height(), diff --git a/webkit/port/platform/graphics/skia/PlatformContextSkia.cpp b/webkit/port/platform/graphics/skia/PlatformContextSkia.cpp index e691b5b..6cc1c0f 100644 --- a/webkit/port/platform/graphics/skia/PlatformContextSkia.cpp +++ b/webkit/port/platform/graphics/skia/PlatformContextSkia.cpp @@ -142,7 +142,7 @@ SkColor PlatformContextSkia::State::applyAlpha(SkColor c) const // PlatformContextSkia --------------------------------------------------------- // Danger: canvas can be NULL. -PlatformContextSkia::PlatformContextSkia(gfx::PlatformCanvas* canvas) +PlatformContextSkia::PlatformContextSkia(skia::PlatformCanvas* canvas) : m_canvas(canvas) , m_stateStack(sizeof(State)) { @@ -163,7 +163,7 @@ PlatformContextSkia::~PlatformContextSkia() #endif } -void PlatformContextSkia::setCanvas(gfx::PlatformCanvas* canvas) +void PlatformContextSkia::setCanvas(skia::PlatformCanvas* canvas) { m_canvas = canvas; } diff --git a/webkit/port/platform/graphics/skia/PlatformContextSkia.h b/webkit/port/platform/graphics/skia/PlatformContextSkia.h index 2e6e4b6..b8dc43f 100644 --- a/webkit/port/platform/graphics/skia/PlatformContextSkia.h +++ b/webkit/port/platform/graphics/skia/PlatformContextSkia.h @@ -63,12 +63,12 @@ class PlatformContextSkia { public: // For printing, there shouldn't be any canvas. canvas can be NULL. If you // supply a NULL canvas, you can also call setCanvas later. - PlatformContextSkia(gfx::PlatformCanvas* canvas); + PlatformContextSkia(skia::PlatformCanvas* canvas); ~PlatformContextSkia(); // Sets the canvas associated with this context. Use when supplying NULL // to the constructor. - void setCanvas(gfx::PlatformCanvas* canvas); + void setCanvas(skia::PlatformCanvas* canvas); void save(); void restore(); @@ -117,7 +117,7 @@ public: SkColor fillColor() const; - gfx::PlatformCanvas* canvas() { return m_canvas; } + skia::PlatformCanvas* canvas() { return m_canvas; } // TODO(brettw) why is this in this class? void drawRect(SkRect rect); @@ -132,7 +132,7 @@ public: // Warning: This function is deprecated so the users are reminded that they // should use this layer of indirection instead of using the canvas // directly. This is to help with the eventual serialization. - gfx::PlatformCanvas* canvas() const; + skia::PlatformCanvas* canvas() const; // Returns if the context is a printing context instead of a display // context. Bitmap shouldn't be resampled when printing to keep the best @@ -148,7 +148,7 @@ private: struct State; // NULL indicates painting is disabled. Never delete this object. - gfx::PlatformCanvas* m_canvas; + skia::PlatformCanvas* m_canvas; // States stack. Enables local drawing state change with save()/restore() // calls. diff --git a/webkit/port/rendering/RenderThemeWin.cpp b/webkit/port/rendering/RenderThemeWin.cpp index 10915a9..1916f99 100644 --- a/webkit/port/rendering/RenderThemeWin.cpp +++ b/webkit/port/rendering/RenderThemeWin.cpp @@ -366,7 +366,7 @@ bool RenderThemeWin::paintButton(RenderObject* o, const ThemeData& themeData = getThemeData(o); WebCore::ThemeHelperWin helper(i.context, r); - gfx::PlatformCanvas* canvas = helper.context()->platformContext()->canvas(); + skia::PlatformCanvas* canvas = helper.context()->platformContext()->canvas(); HDC hdc = canvas->beginPlatformPaint(); int state = themeData.m_state; @@ -439,7 +439,7 @@ bool RenderThemeWin::paintMenuList(RenderObject* o, const RenderObject::PaintInf // Get the correct theme data for a textfield and paint the menu. WebCore::ThemeHelperWin helper(i.context, rect); - gfx::PlatformCanvas* canvas = helper.context()->platformContext()->canvas(); + skia::PlatformCanvas* canvas = helper.context()->platformContext()->canvas(); HDC hdc = canvas->beginPlatformPaint(); RECT renderRect = helper.rect(); gfx::NativeTheme::instance()->PaintMenuList(hdc, @@ -580,7 +580,7 @@ bool RenderThemeWin::paintTextFieldInternal(RenderObject* o, const ThemeData& themeData = getThemeData(o); WebCore::ThemeHelperWin helper(i.context, r); - gfx::PlatformCanvas* canvas = helper.context()->platformContext()->canvas(); + skia::PlatformCanvas* canvas = helper.context()->platformContext()->canvas(); HDC hdc = canvas->beginPlatformPaint(); COLORREF clr = skia::SkColorToCOLORREF(o->style()->backgroundColor().rgb()); diff --git a/webkit/tools/test_shell/mac/webwidget_host.mm b/webkit/tools/test_shell/mac/webwidget_host.mm index 95c2b92..2050f909 100644 --- a/webkit/tools/test_shell/mac/webwidget_host.mm +++ b/webkit/tools/test_shell/mac/webwidget_host.mm @@ -157,7 +157,7 @@ void WebWidgetHost::Paint() { if (!canvas_.get()) { ResetScrollRect(); paint_rect_ = client_rect; - canvas_.reset(new gfx::PlatformCanvas( + canvas_.reset(new skia::PlatformCanvas( paint_rect_.width(), paint_rect_.height(), true)); } diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc index 6367712..4d7404b 100644 --- a/webkit/tools/test_shell/test_shell.cc +++ b/webkit/tools/test_shell/test_shell.cc @@ -169,7 +169,7 @@ static void UnitTestAssertHandler(const std::string& str) { // static std::string TestShell::DumpImage(WebFrame* web_frame, const std::wstring& file_name) { - scoped_ptr<gfx::BitmapPlatformDevice> device; + scoped_ptr<skia::BitmapPlatformDevice> device; if (!web_frame->CaptureImage(&device, true)) return std::string(); diff --git a/webkit/tools/test_shell/webwidget_host.h b/webkit/tools/test_shell/webwidget_host.h index 0b4e197..8498c4f 100644 --- a/webkit/tools/test_shell/webwidget_host.h +++ b/webkit/tools/test_shell/webwidget_host.h @@ -100,7 +100,7 @@ class WebWidgetHost { gfx::NativeView view_; WebWidget* webwidget_; - scoped_ptr<gfx::PlatformCanvas> canvas_; + scoped_ptr<skia::PlatformCanvas> canvas_; // specifies the portion of the webwidget that needs painting gfx::Rect paint_rect_; diff --git a/webkit/tools/test_shell/webwidget_host_gtk.cc b/webkit/tools/test_shell/webwidget_host_gtk.cc index 2e525b5..f873fa1 100644 --- a/webkit/tools/test_shell/webwidget_host_gtk.cc +++ b/webkit/tools/test_shell/webwidget_host_gtk.cc @@ -220,7 +220,7 @@ void WebWidgetHost::Paint() { if (!canvas_.get()) { ResetScrollRect(); paint_rect_ = client_rect; - canvas_.reset(new gfx::PlatformCanvas(width, height, true)); + canvas_.reset(new skia::PlatformCanvas(width, height, true)); if (!canvas_.get()) { // memory allocation failed, we can't paint. LOG(ERROR) << "Failed to allocate memory for " << width << "x" << height; @@ -262,9 +262,9 @@ void WebWidgetHost::Paint() { gdk_window_begin_paint_rect(view_->window, &grect); // BitBlit to the gdk window. - gfx::PlatformDeviceLinux &platdev = canvas_->getTopPlatformDevice(); - gfx::BitmapPlatformDeviceLinux* const bitdev = - static_cast<gfx::BitmapPlatformDeviceLinux* >(&platdev); + skia::PlatformDeviceLinux &platdev = canvas_->getTopPlatformDevice(); + skia::BitmapPlatformDeviceLinux* const bitdev = + static_cast<skia::BitmapPlatformDeviceLinux* >(&platdev); cairo_t* cairo_drawable = gdk_cairo_create(view_->window); cairo_set_source_surface(cairo_drawable, bitdev->surface(), 0, 0); cairo_paint(cairo_drawable); diff --git a/webkit/tools/test_shell/webwidget_host_win.cc b/webkit/tools/test_shell/webwidget_host_win.cc index efe4d8b..3f56002 100644 --- a/webkit/tools/test_shell/webwidget_host_win.cc +++ b/webkit/tools/test_shell/webwidget_host_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved........... // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -213,7 +213,7 @@ void WebWidgetHost::Paint() { if (!canvas_.get()) { ResetScrollRect(); paint_rect_ = client_rect; - canvas_.reset(new gfx::PlatformCanvas( + canvas_.reset(new skia::PlatformCanvas( paint_rect_.width(), paint_rect_.height(), true)); } |