OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 ATOM atom = RegisterClassEx(&class_ex); | 92 ATOM atom = RegisterClassEx(&class_ex); |
93 DCHECK(atom); | 93 DCHECK(atom); |
94 } | 94 } |
95 | 95 |
96 void UnregisterMyClass() { | 96 void UnregisterMyClass() { |
97 ::UnregisterClass(kWindowClassName, NULL); | 97 ::UnregisterClass(kWindowClassName, NULL); |
98 } | 98 } |
99 | 99 |
100 HWND hwnd_; | 100 HWND hwnd_; |
101 | 101 |
102 ScopedComPtr<ID2D1RenderTarget> rt_; | 102 base::win::ScopedComPtr<ID2D1RenderTarget> rt_; |
103 | 103 |
104 DISALLOW_COPY_AND_ASSIGN(TestWindow); | 104 DISALLOW_COPY_AND_ASSIGN(TestWindow); |
105 }; | 105 }; |
106 | 106 |
107 // Loads a png data blob from the data resources associated with this | 107 // Loads a png data blob from the data resources associated with this |
108 // executable, decodes it and returns a SkBitmap. | 108 // executable, decodes it and returns a SkBitmap. |
109 SkBitmap LoadBitmapFromResources(int resource_id) { | 109 SkBitmap LoadBitmapFromResources(int resource_id) { |
110 SkBitmap bitmap; | 110 SkBitmap bitmap; |
111 | 111 |
112 HINSTANCE resource_instance = GetModuleHandle(NULL); | 112 HINSTANCE resource_instance = GetModuleHandle(NULL); |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 return; | 323 return; |
324 TestWindow window; | 324 TestWindow window; |
325 gfx::CanvasDirect2D canvas(window.rt()); | 325 gfx::CanvasDirect2D canvas(window.rt()); |
326 | 326 |
327 SkBitmap bitmap = LoadBitmapFromResources(IDR_BITMAP_BRUSH_IMAGE); | 327 SkBitmap bitmap = LoadBitmapFromResources(IDR_BITMAP_BRUSH_IMAGE); |
328 | 328 |
329 canvas.Save(); | 329 canvas.Save(); |
330 canvas.TileImageInt(bitmap, 10, 10, 300, 300); | 330 canvas.TileImageInt(bitmap, 10, 10, 300, 300); |
331 canvas.Restore(); | 331 canvas.Restore(); |
332 } | 332 } |
OLD | NEW |