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 const SkImageInfo& info = cinfo.fInfo; |
| 288 const bool do_clear = !info.isOpaque(); |
| 289 SkASSERT(info.colorType() == kN32_SkColorType); |
| 290 return Create(info.width(), info.height(), info.isOpaque(), NULL, do_clear); |
| 291 } |
| 292 |
285 // PlatformCanvas impl | 293 // PlatformCanvas impl |
286 | 294 |
287 SkCanvas* CreatePlatformCanvas(int width, | 295 SkCanvas* CreatePlatformCanvas(int width, |
288 int height, | 296 int height, |
289 bool is_opaque, | 297 bool is_opaque, |
290 HANDLE shared_section, | 298 HANDLE shared_section, |
291 OnFailureType failureType) { | 299 OnFailureType failureType) { |
292 skia::RefPtr<SkBaseDevice> dev = skia::AdoptRef( | 300 skia::RefPtr<SkBaseDevice> dev = skia::AdoptRef( |
293 BitmapPlatformDevice::Create(width, height, is_opaque, shared_section)); | 301 BitmapPlatformDevice::Create(width, height, is_opaque, shared_section)); |
294 return CreateCanvas(dev, failureType); | 302 return CreateCanvas(dev, failureType); |
(...skipping 24 matching lines...) Expand all Loading... |
319 platform_extra_ = reinterpret_cast<intptr_t>(stock_bitmap); | 327 platform_extra_ = reinterpret_cast<intptr_t>(stock_bitmap); |
320 | 328 |
321 if (!InstallHBitmapPixels(&bitmap_, width, height, is_opaque, data, hbitmap)) | 329 if (!InstallHBitmapPixels(&bitmap_, width, height, is_opaque, data, hbitmap)) |
322 return false; | 330 return false; |
323 bitmap_.lockPixels(); | 331 bitmap_.lockPixels(); |
324 | 332 |
325 return true; | 333 return true; |
326 } | 334 } |
327 | 335 |
328 } // namespace skia | 336 } // namespace skia |
OLD | NEW |