OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <psapi.h> | 6 #include <psapi.h> |
7 | 7 |
8 #include "base/debug/gdi_debug_util_win.h" | 8 #include "base/debug/gdi_debug_util_win.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "skia/ext/bitmap_platform_device_win.h" | 10 #include "skia/ext/bitmap_platform_device_win.h" |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 } | 263 } |
264 | 264 |
265 const SkBitmap& BitmapPlatformDevice::onAccessBitmap() { | 265 const SkBitmap& BitmapPlatformDevice::onAccessBitmap() { |
266 // FIXME(brettw) OPTIMIZATION: We should only flush if we know a GDI | 266 // FIXME(brettw) OPTIMIZATION: We should only flush if we know a GDI |
267 // operation has occurred on our DC. | 267 // operation has occurred on our DC. |
268 if (IsBitmapDCCreated()) | 268 if (IsBitmapDCCreated()) |
269 GdiFlush(); | 269 GdiFlush(); |
270 return SkBitmapDevice::onAccessBitmap(); | 270 return SkBitmapDevice::onAccessBitmap(); |
271 } | 271 } |
272 | 272 |
273 SkBaseDevice* BitmapPlatformDevice::onCreateDevice(const SkImageInfo& info, | 273 SkBaseDevice* BitmapPlatformDevice::onCreateCompatibleDevice( |
274 Usage /*usage*/) { | 274 const CreateInfo& info) { |
275 SkASSERT(info.colorType() == kN32_SkColorType); | 275 SkASSERT(info.fInfo.colorType() == kN32_SkColorType); |
276 return BitmapPlatformDevice::CreateAndClear(info.width(), info.height(), | 276 return BitmapPlatformDevice::CreateAndClear(info.fInfo.width(), |
277 info.isOpaque()); | 277 info.fInfo.height(), |
| 278 info.fInfo.isOpaque()); |
278 } | 279 } |
279 | 280 |
280 // PlatformCanvas impl | 281 // PlatformCanvas impl |
281 | 282 |
282 SkCanvas* CreatePlatformCanvas(int width, | 283 SkCanvas* CreatePlatformCanvas(int width, |
283 int height, | 284 int height, |
284 bool is_opaque, | 285 bool is_opaque, |
285 HANDLE shared_section, | 286 HANDLE shared_section, |
286 OnFailureType failureType) { | 287 OnFailureType failureType) { |
287 skia::RefPtr<SkBaseDevice> dev = skia::AdoptRef( | 288 skia::RefPtr<SkBaseDevice> dev = skia::AdoptRef( |
(...skipping 26 matching lines...) Expand all Loading... |
314 platform_extra_ = reinterpret_cast<intptr_t>(stock_bitmap); | 315 platform_extra_ = reinterpret_cast<intptr_t>(stock_bitmap); |
315 | 316 |
316 if (!InstallHBitmapPixels(&bitmap_, width, height, is_opaque, data, hbitmap)) | 317 if (!InstallHBitmapPixels(&bitmap_, width, height, is_opaque, data, hbitmap)) |
317 return false; | 318 return false; |
318 bitmap_.lockPixels(); | 319 bitmap_.lockPixels(); |
319 | 320 |
320 return true; | 321 return true; |
321 } | 322 } |
322 | 323 |
323 } // namespace skia | 324 } // namespace skia |
OLD | NEW |