summaryrefslogtreecommitdiffstats
path: root/skia/ext/platform_canvas.h
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-07 18:06:45 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-07 18:06:45 +0000
commita502bbe7a3ea0d4909e4e163ab00a1f3be483143 (patch)
treec53bf6b7492be39d1fb2eaa4cacbc74f8d0c8cb1 /skia/ext/platform_canvas.h
parent8ebb7703fb1fd95f993081e674d04167fe1413fc (diff)
downloadchromium_src-a502bbe7a3ea0d4909e4e163ab00a1f3be483143.zip
chromium_src-a502bbe7a3ea0d4909e4e163ab00a1f3be483143.tar.gz
chromium_src-a502bbe7a3ea0d4909e4e163ab00a1f3be483143.tar.bz2
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
Diffstat (limited to 'skia/ext/platform_canvas.h')
-rw-r--r--skia/ext/platform_canvas.h41
1 files changed, 20 insertions, 21 deletions
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&);