| 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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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::onCreateDevice(const SkImageInfo& info, |
| 274 Usage /*usage*/) { | 274 Usage /*usage*/) { |
| 275 SkASSERT(info.colorType() == kPMColor_SkColorType); | 275 SkASSERT(info.colorType() == kN32_SkColorType); |
| 276 return BitmapPlatformDevice::CreateAndClear(info.width(), info.height(), | 276 return BitmapPlatformDevice::CreateAndClear(info.width(), info.height(), |
| 277 info.isOpaque()); | 277 info.isOpaque()); |
| 278 } | 278 } |
| 279 | 279 |
| 280 // PlatformCanvas impl | 280 // PlatformCanvas impl |
| 281 | 281 |
| 282 SkCanvas* CreatePlatformCanvas(int width, | 282 SkCanvas* CreatePlatformCanvas(int width, |
| 283 int height, | 283 int height, |
| 284 bool is_opaque, | 284 bool is_opaque, |
| 285 HANDLE shared_section, | 285 HANDLE shared_section, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 314 platform_extra_ = reinterpret_cast<intptr_t>(stock_bitmap); | 314 platform_extra_ = reinterpret_cast<intptr_t>(stock_bitmap); |
| 315 | 315 |
| 316 if (!InstallHBitmapPixels(&bitmap_, width, height, is_opaque, data, hbitmap)) | 316 if (!InstallHBitmapPixels(&bitmap_, width, height, is_opaque, data, hbitmap)) |
| 317 return false; | 317 return false; |
| 318 bitmap_.lockPixels(); | 318 bitmap_.lockPixels(); |
| 319 | 319 |
| 320 return true; | 320 return true; |
| 321 } | 321 } |
| 322 | 322 |
| 323 } // namespace skia | 323 } // namespace skia |
| OLD | NEW |