Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: skia/ext/bitmap_platform_device_win.cc

Issue 1013453002: remove deprecated onCreateCompatibleDevice (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « skia/ext/bitmap_platform_device_win.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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(
278 const CreateInfo& cinfo) {
279 const SkImageInfo& info = cinfo.fInfo;
280 const bool do_clear = !info.isOpaque();
281 SkASSERT(info.colorType() == kN32_SkColorType);
282 return Create(info.width(), info.height(), info.isOpaque(), NULL, do_clear);
283 }
284
285 SkBaseDevice* BitmapPlatformDevice::onCreateDevice(const CreateInfo& cinfo, 277 SkBaseDevice* BitmapPlatformDevice::onCreateDevice(const CreateInfo& cinfo,
286 const SkPaint*) { 278 const SkPaint*) {
287 const SkImageInfo& info = cinfo.fInfo; 279 const SkImageInfo& info = cinfo.fInfo;
288 const bool do_clear = !info.isOpaque(); 280 const bool do_clear = !info.isOpaque();
289 SkASSERT(info.colorType() == kN32_SkColorType); 281 SkASSERT(info.colorType() == kN32_SkColorType);
290 return Create(info.width(), info.height(), info.isOpaque(), NULL, do_clear); 282 return Create(info.width(), info.height(), info.isOpaque(), NULL, do_clear);
291 } 283 }
292 284
293 // PlatformCanvas impl 285 // PlatformCanvas impl
294 286
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 platform_extra_ = reinterpret_cast<intptr_t>(stock_bitmap); 319 platform_extra_ = reinterpret_cast<intptr_t>(stock_bitmap);
328 320
329 if (!InstallHBitmapPixels(&bitmap_, width, height, is_opaque, data, hbitmap)) 321 if (!InstallHBitmapPixels(&bitmap_, width, height, is_opaque, data, hbitmap))
330 return false; 322 return false;
331 bitmap_.lockPixels(); 323 bitmap_.lockPixels();
332 324
333 return true; 325 return true;
334 } 326 }
335 327
336 } // namespace skia 328 } // namespace skia
OLDNEW
« no previous file with comments | « skia/ext/bitmap_platform_device_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698