| 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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 } | 275 } |
| 276 | 276 |
| 277 SkBaseDevice* BitmapPlatformDevice::onCreateCompatibleDevice( | 277 SkBaseDevice* BitmapPlatformDevice::onCreateCompatibleDevice( |
| 278 const CreateInfo& cinfo) { | 278 const CreateInfo& cinfo) { |
| 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 SkBaseDevice* BitmapPlatformDevice::onCreateDevice(const CreateInfo& cinfo, | |
| 286 const SkPaint*) { | |
| 287 // until skia lands its new virtual for this method | |
| 288 return onCreateCompatibleDevice(cinfo); | |
| 289 } | |
| 290 | |
| 291 // PlatformCanvas impl | 285 // PlatformCanvas impl |
| 292 | 286 |
| 293 SkCanvas* CreatePlatformCanvas(int width, | 287 SkCanvas* CreatePlatformCanvas(int width, |
| 294 int height, | 288 int height, |
| 295 bool is_opaque, | 289 bool is_opaque, |
| 296 HANDLE shared_section, | 290 HANDLE shared_section, |
| 297 OnFailureType failureType) { | 291 OnFailureType failureType) { |
| 298 skia::RefPtr<SkBaseDevice> dev = skia::AdoptRef( | 292 skia::RefPtr<SkBaseDevice> dev = skia::AdoptRef( |
| 299 BitmapPlatformDevice::Create(width, height, is_opaque, shared_section)); | 293 BitmapPlatformDevice::Create(width, height, is_opaque, shared_section)); |
| 300 return CreateCanvas(dev, failureType); | 294 return CreateCanvas(dev, failureType); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 325 platform_extra_ = reinterpret_cast<intptr_t>(stock_bitmap); | 319 platform_extra_ = reinterpret_cast<intptr_t>(stock_bitmap); |
| 326 | 320 |
| 327 if (!InstallHBitmapPixels(&bitmap_, width, height, is_opaque, data, hbitmap)) | 321 if (!InstallHBitmapPixels(&bitmap_, width, height, is_opaque, data, hbitmap)) |
| 328 return false; | 322 return false; |
| 329 bitmap_.lockPixels(); | 323 bitmap_.lockPixels(); |
| 330 | 324 |
| 331 return true; | 325 return true; |
| 332 } | 326 } |
| 333 | 327 |
| 334 } // namespace skia | 328 } // namespace skia |
| OLD | NEW |