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 "skia/ext/bitmap_platform_device_win.h" | 8 #include "skia/ext/bitmap_platform_device_win.h" |
9 | 9 |
10 #include "skia/ext/bitmap_platform_device_data.h" | 10 #include "skia/ext/bitmap_platform_device_data.h" |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 copy_height, | 240 copy_height, |
241 blend_function); | 241 blend_function); |
242 } | 242 } |
243 LoadTransformToDC(source_dc, data_->transform()); | 243 LoadTransformToDC(source_dc, data_->transform()); |
244 | 244 |
245 EndPlatformPaint(); | 245 EndPlatformPaint(); |
246 if (created_dc) | 246 if (created_dc) |
247 data_->ReleaseBitmapDC(); | 247 data_->ReleaseBitmapDC(); |
248 } | 248 } |
249 | 249 |
250 void BitmapPlatformDevice::onAccessBitmap(SkBitmap* bitmap) { | 250 const SkBitmap& BitmapPlatformDevice::onAccessBitmap(SkBitmap* bitmap) { |
251 // FIXME(brettw) OPTIMIZATION: We should only flush if we know a GDI | 251 // FIXME(brettw) OPTIMIZATION: We should only flush if we know a GDI |
252 // operation has occurred on our DC. | 252 // operation has occurred on our DC. |
253 if (data_->IsBitmapDCCreated()) | 253 if (data_->IsBitmapDCCreated()) |
254 GdiFlush(); | 254 GdiFlush(); |
| 255 return *bitmap; |
255 } | 256 } |
256 | 257 |
257 SkDevice* BitmapPlatformDevice::onCreateCompatibleDevice( | 258 SkDevice* BitmapPlatformDevice::onCreateCompatibleDevice( |
258 SkBitmap::Config config, int width, int height, bool isOpaque, | 259 SkBitmap::Config config, int width, int height, bool isOpaque, |
259 Usage /*usage*/) { | 260 Usage /*usage*/) { |
260 SkASSERT(config == SkBitmap::kARGB_8888_Config); | 261 SkASSERT(config == SkBitmap::kARGB_8888_Config); |
261 return BitmapPlatformDevice::create(width, height, isOpaque, NULL); | 262 return BitmapPlatformDevice::create(width, height, isOpaque, NULL); |
262 } | 263 } |
263 | 264 |
264 } // namespace skia | 265 } // namespace skia |
OLD | NEW |