From a502bbe7a3ea0d4909e4e163ab00a1f3be483143 Mon Sep 17 00:00:00 2001 From: "erg@google.com" Date: Fri, 7 Jan 2011 18:06:45 +0000 Subject: Start sorting methods in class declarations. A lot of our headers are a mess and aren't organized. Impose the following order on files in the base/ directory: class Blah { each public/protected/private section: typedefs; enums; static constants; ctors; dtors; methods; overridden virtual methods; data members; }; BUG=68682 TEST=compiles Review URL: http://codereview.chromium.org/6081007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70749 0039d316-1c4b-4281-b951-d872f2087c98 --- skia/ext/platform_canvas.h | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) (limited to 'skia/ext/platform_canvas.h') diff --git a/skia/ext/platform_canvas.h b/skia/ext/platform_canvas.h index 1e51717..fd65fc0 100644 --- a/skia/ext/platform_canvas.h +++ b/skia/ext/platform_canvas.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -24,32 +24,15 @@ class PlatformCanvas : public SkCanvas { // Set is_opaque if you are going to erase the bitmap and not use // transparency: this will enable some optimizations. PlatformCanvas(int width, int height, bool is_opaque); - virtual ~PlatformCanvas(); #if defined(WIN32) - // Windows ------------------------------------------------------------------ - // The shared_section parameter is passed to gfx::PlatformDevice::create. // See it for details. PlatformCanvas(int width, int height, bool is_opaque, HANDLE shared_section); - - // For two-part init, call if you use the no-argument constructor above. Note - // that we want this to optionally match the Linux initialize if you only - // pass 3 arguments, hence the evil default argument. - bool initialize(int width, int height, bool is_opaque, - HANDLE shared_section = NULL); - #elif defined(__APPLE__) - // Mac ----------------------------------------------------------------------- - PlatformCanvas(int width, int height, bool is_opaque, CGContextRef context); PlatformCanvas(int width, int height, bool is_opaque, uint8_t* context); - - // For two-part init, call if you use the no-argument constructor above - bool initialize(CGContextRef context, int width, int height, bool is_opaque); - bool initialize(int width, int height, bool is_opaque, uint8_t* data = NULL); - #elif defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || \ defined(__Solaris__) // Linux --------------------------------------------------------------------- @@ -57,11 +40,27 @@ class PlatformCanvas : public SkCanvas { // Construct a canvas from the given memory region. The memory is not cleared // first. @data must be, at least, @height * StrideForWidth(@width) bytes. PlatformCanvas(int width, int height, bool is_opaque, uint8_t* data); +#endif + + virtual ~PlatformCanvas(); +#if defined(WIN32) + // For two-part init, call if you use the no-argument constructor above. Note + // that we want this to optionally match the Linux initialize if you only + // pass 3 arguments, hence the evil default argument. + bool initialize(int width, int height, bool is_opaque, + HANDLE shared_section = NULL); +#elif defined(__APPLE__) // For two-part init, call if you use the no-argument constructor above + bool initialize(CGContextRef context, int width, int height, bool is_opaque); bool initialize(int width, int height, bool is_opaque, uint8_t* data = NULL); +#elif defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || \ + defined(__Solaris__) + // For two-part init, call if you use the no-argument constructor above + bool initialize(int width, int height, bool is_opaque, uint8_t* data = NULL); #endif + // Shared -------------------------------------------------------------------- // These calls should surround calls to platform drawing routines, the @@ -99,6 +98,9 @@ class PlatformCanvas : public SkCanvas { using SkCanvas::clipRect; private: + // Helper method used internally by the initialize() methods. + bool initializeWithDevice(SkDevice* device); + // Unimplemented. This is to try to prevent people from calling this function // on SkCanvas. SkCanvas' version is not virtual, so we can't prevent this // 100%, but hopefully this will make people notice and not use the function. @@ -107,9 +109,6 @@ class PlatformCanvas : public SkCanvas { // CoreGraphics. virtual SkDevice* setBitmapDevice(const SkBitmap& bitmap); - // Helper method used internally by the initialize() methods. - bool initializeWithDevice(SkDevice* device); - // Disallow copy and assign. PlatformCanvas(const PlatformCanvas&); PlatformCanvas& operator=(const PlatformCanvas&); -- cgit v1.1