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

Unified Diff: ui/gfx/image/canvas_image_source.cc

Issue 10702136: Support high dpi in menu scroll arrow, submenu arrow and drag_utils. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 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
Index: ui/gfx/image/canvas_image_source.cc
diff --git a/ui/gfx/image/canvas_image_source.cc b/ui/gfx/image/canvas_image_source.cc
new file mode 100644
index 0000000000000000000000000000000000000000..38f6db838bd10cd9dc484c96fbee06ad5ae28cc3
--- /dev/null
+++ b/ui/gfx/image/canvas_image_source.cc
@@ -0,0 +1,28 @@
+// 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 "ui/gfx/image/canvas_image_source.h"
+
+#include "base/logging.h"
+#include "ui/gfx/canvas.h"
+#include "ui/base/layout.h"
+
+namespace gfx {
+
+////////////////////////////////////////////////////////////////////////////////
+// CanvasImageSource
+
+CanvasImageSource::CanvasImageSource(const gfx::Size& size, bool is_opaque)
+ : size_(size),
+ is_opaque_(is_opaque) {
+}
+
+gfx::ImageSkiaRep CanvasImageSource::GetImageForScale(
+ ui::ScaleFactor scale_factor) {
+ gfx::Canvas canvas(size_, scale_factor, is_opaque_);
+ Draw(&canvas);
+ return canvas.ExtractImageSkiaRep();
+}
+
+} // namespace gfx

Powered by Google App Engine
This is Rietveld 408576698