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

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

Issue 1013463003: Update from https://crrev.com/320931 (Closed) Base URL: https://github.com/domokit/mojo.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') | skia/ext/opacity_draw_filter.cc » ('j') | 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( 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
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
OLDNEW
« no previous file with comments | « skia/ext/bitmap_platform_device_win.h ('k') | skia/ext/opacity_draw_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698