summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/android/ImageBufferAndroid.cpp
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2008-10-21 07:00:00 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2008-10-21 07:00:00 -0700
commit9364f22aed35e1a1e9d07c121510f80be3ab0502 (patch)
treed49911209b132da58d838efa852daf28d516df21 /WebCore/platform/graphics/android/ImageBufferAndroid.cpp
parent87eb0cb35bad8784770ebc807e6c982432e47107 (diff)
downloadexternal_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.zip
external_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.tar.gz
external_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.tar.bz2
Initial Contribution
Diffstat (limited to 'WebCore/platform/graphics/android/ImageBufferAndroid.cpp')
-rw-r--r--WebCore/platform/graphics/android/ImageBufferAndroid.cpp53
1 files changed, 53 insertions, 0 deletions
diff --git a/WebCore/platform/graphics/android/ImageBufferAndroid.cpp b/WebCore/platform/graphics/android/ImageBufferAndroid.cpp
new file mode 100644
index 0000000..65fb7cd
--- /dev/null
+++ b/WebCore/platform/graphics/android/ImageBufferAndroid.cpp
@@ -0,0 +1,53 @@
+/* ImageBufferAndroid.cpp
+**
+** Copyright 2007, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+
+#include "config.h"
+#include "ImageBuffer.h"
+
+#include "GraphicsContext.h"
+
+using namespace std;
+
+namespace WebCore {
+
+auto_ptr<ImageBuffer> ImageBuffer::create(const IntSize& size, bool grayScale)
+{
+ // Ignore grayScale for now, since SkBitmap doesn't support it... yet
+
+ GraphicsContext* ctx = GraphicsContext::createOffscreenContext(size.width(), size.height());
+
+ auto_ptr<GraphicsContext> context(ctx);
+
+ return auto_ptr<ImageBuffer>(new ImageBuffer(size, context));
+}
+
+
+ImageBuffer::ImageBuffer(const IntSize& size, auto_ptr<GraphicsContext> context)
+ : m_data(NULL), m_size(size), m_context(context.release())
+{
+}
+
+ImageBuffer::~ImageBuffer()
+{
+}
+
+GraphicsContext* ImageBuffer::context() const
+{
+ return m_context.get();
+}
+
+}