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

Unified Diff: skia/ext/platform_canvas_skia.cc

Issue 9722032: aura: Use platform independent skia::PlatformCanvas when possible. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use platform independent PlatformCanvas when use_aura=1 Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | skia/skia.gyp » ('j') | skia/skia.gyp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/platform_canvas_skia.cc
diff --git a/skia/ext/platform_canvas_skia.cc b/skia/ext/platform_canvas_skia.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7a128fec0f16a82483cfb849195b53cf7ce4ead9
--- /dev/null
+++ b/skia/ext/platform_canvas_skia.cc
@@ -0,0 +1,36 @@
+// Copyright (c) 2012 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.
+
+#include "skia/ext/platform_canvas.h"
+
+#include "base/debug/trace_event.h"
+
+namespace skia {
+
+PlatformCanvas::PlatformCanvas(int width, int height, bool is_opaque) {
+ TRACE_EVENT2("skia", "PlatformCanvas::PlatformCanvas",
+ "width", width, "height", height);
+ if (!initialize(width, height, is_opaque))
+ SK_CRASH();
+}
+
+PlatformCanvas::PlatformCanvas(int width, int height, bool is_opaque,
+ uint8_t* data) {
+ TRACE_EVENT2("skia", "PlatformCanvas::PlatformCanvas",
+ "width", width, "height", height);
+ if (!initialize(width, height, is_opaque, data))
+ SK_CRASH();
+}
+
+PlatformCanvas::~PlatformCanvas() {
+}
+
+bool PlatformCanvas::initialize(int width, int height, bool is_opaque,
+ uint8_t* data) {
+ return initializeWithDevice(new SkDevice(SkBitmap::kARGB_8888_Config,
+ width, height,
+ is_opaque));
+}
+
+} // namespace skia
« no previous file with comments | « no previous file | skia/skia.gyp » ('j') | skia/skia.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698