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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 } | 267 } |
268 | 268 |
269 const SkBitmap& BitmapPlatformDevice::onAccessBitmap() { | 269 const SkBitmap& BitmapPlatformDevice::onAccessBitmap() { |
270 // FIXME(brettw) OPTIMIZATION: We should only flush if we know a GDI | 270 // FIXME(brettw) OPTIMIZATION: We should only flush if we know a GDI |
271 // operation has occurred on our DC. | 271 // operation has occurred on our DC. |
272 if (IsBitmapDCCreated()) | 272 if (IsBitmapDCCreated()) |
273 GdiFlush(); | 273 GdiFlush(); |
274 return SkBitmapDevice::onAccessBitmap(); | 274 return SkBitmapDevice::onAccessBitmap(); |
275 } | 275 } |
276 | 276 |
277 SkBaseDevice* BitmapPlatformDevice::onCreateCompatibleDevice( | 277 SkBaseDevice* BitmapPlatformDevice::onCreateDevice(const CreateInfo& cinfo, |
278 const CreateInfo& cinfo) { | 278 const SkPaint*) { |
279 const SkImageInfo& info = cinfo.fInfo; | 279 const SkImageInfo& info = cinfo.fInfo; |
280 const bool do_clear = !info.isOpaque(); | 280 const bool do_clear = !info.isOpaque(); |
281 SkASSERT(info.colorType() == kN32_SkColorType); | 281 SkASSERT(info.colorType() == kN32_SkColorType); |
282 return Create(info.width(), info.height(), info.isOpaque(), NULL, do_clear); | 282 return Create(info.width(), info.height(), info.isOpaque(), NULL, do_clear); |
283 } | 283 } |
284 | 284 |
285 // PlatformCanvas impl | 285 // PlatformCanvas impl |
286 | 286 |
287 SkCanvas* CreatePlatformCanvas(int width, | 287 SkCanvas* CreatePlatformCanvas(int width, |
288 int height, | 288 int height, |
(...skipping 30 matching lines...) Expand all Loading... |
319 platform_extra_ = reinterpret_cast<intptr_t>(stock_bitmap); | 319 platform_extra_ = reinterpret_cast<intptr_t>(stock_bitmap); |
320 | 320 |
321 if (!InstallHBitmapPixels(&bitmap_, width, height, is_opaque, data, hbitmap)) | 321 if (!InstallHBitmapPixels(&bitmap_, width, height, is_opaque, data, hbitmap)) |
322 return false; | 322 return false; |
323 bitmap_.lockPixels(); | 323 bitmap_.lockPixels(); |
324 | 324 |
325 return true; | 325 return true; |
326 } | 326 } |
327 | 327 |
328 } // namespace skia | 328 } // namespace skia |
OLD | NEW |