| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <windows.h> | 5 #include <windows.h> |
| 6 #include <uxtheme.h> | 6 #include <uxtheme.h> |
| 7 #include <vsstyle.h> | 7 #include <vsstyle.h> |
| 8 #include <vssym32.h> | 8 #include <vssym32.h> |
| 9 | 9 |
| 10 #include "app/win/window_impl.h" |
| 10 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 11 #include "base/ref_counted_memory.h" | 12 #include "base/ref_counted_memory.h" |
| 12 #include "base/resource_util.h" | 13 #include "base/resource_util.h" |
| 13 #include "base/scoped_ptr.h" | 14 #include "base/scoped_ptr.h" |
| 14 #include "gfx/brush.h" | 15 #include "gfx/brush.h" |
| 15 #include "gfx/canvas_direct2d.h" | 16 #include "gfx/canvas_direct2d.h" |
| 16 #include "gfx/canvas_skia.h" | 17 #include "gfx/canvas_skia.h" |
| 17 #include "gfx/codec/png_codec.h" | 18 #include "gfx/codec/png_codec.h" |
| 18 #include "gfx/native_theme_win.h" | 19 #include "gfx/native_theme_win.h" |
| 19 #include "gfx/window_impl.h" | |
| 20 #include "gfx/win_util.h" | 20 #include "gfx/win_util.h" |
| 21 #include "grit/gfx_resources.h" | 21 #include "grit/gfx_resources.h" |
| 22 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
| 23 | 23 |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 const char kVisibleModeFlag[] = "d2d-canvas-visible"; | 27 const char kVisibleModeFlag[] = "d2d-canvas-visible"; |
| 28 | 28 |
| 29 class TestWindow : public gfx::WindowImpl { | 29 class TestWindow : public app::win::WindowImpl { |
| 30 public: | 30 public: |
| 31 static const int kWindowSize = 500; | 31 static const int kWindowSize = 500; |
| 32 static const int kWindowPosition = 10; | 32 static const int kWindowPosition = 10; |
| 33 | 33 |
| 34 | 34 |
| 35 TestWindow() { | 35 TestWindow() { |
| 36 if (CommandLine::ForCurrentProcess()->HasSwitch(kVisibleModeFlag)) | 36 if (CommandLine::ForCurrentProcess()->HasSwitch(kVisibleModeFlag)) |
| 37 Sleep(1000); | 37 Sleep(1000); |
| 38 | 38 |
| 39 // Create the window. | 39 // Create the window. |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 return; | 312 return; |
| 313 TestWindow window; | 313 TestWindow window; |
| 314 gfx::CanvasDirect2D canvas(window.rt()); | 314 gfx::CanvasDirect2D canvas(window.rt()); |
| 315 | 315 |
| 316 SkBitmap bitmap = LoadBitmapFromResources(IDR_BITMAP_BRUSH_IMAGE); | 316 SkBitmap bitmap = LoadBitmapFromResources(IDR_BITMAP_BRUSH_IMAGE); |
| 317 | 317 |
| 318 canvas.Save(); | 318 canvas.Save(); |
| 319 canvas.TileImageInt(bitmap, 10, 10, 300, 300); | 319 canvas.TileImageInt(bitmap, 10, 10, 300, 300); |
| 320 canvas.Restore(); | 320 canvas.Restore(); |
| 321 } | 321 } |
| OLD | NEW |