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

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

Issue 316663002: use non-deprecated version of installPixel() that takes colortable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 100
101 static void DeleteHBitmapCallback(void* addr, void* context) { 101 static void DeleteHBitmapCallback(void* addr, void* context) {
102 DeleteObject(static_cast<HBITMAP>(context)); 102 DeleteObject(static_cast<HBITMAP>(context));
103 } 103 }
104 104
105 static bool InstallHBitmapPixels(SkBitmap* bitmap, int width, int height, 105 static bool InstallHBitmapPixels(SkBitmap* bitmap, int width, int height,
106 bool is_opaque, void* data, HBITMAP hbitmap) { 106 bool is_opaque, void* data, HBITMAP hbitmap) {
107 const SkAlphaType at = is_opaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType; 107 const SkAlphaType at = is_opaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType;
108 const SkImageInfo info = SkImageInfo::MakeN32(width, height, at); 108 const SkImageInfo info = SkImageInfo::MakeN32(width, height, at);
109 const size_t rowBytes = info.minRowBytes(); 109 const size_t rowBytes = info.minRowBytes();
110 return bitmap->installPixels(info, data, rowBytes, DeleteHBitmapCallback, 110 SkColorType* color_table = NULL;
111 hbitmap); 111 return bitmap->installPixels(info, data, rowBytes, color_table,
f(malita) 2014/06/03 17:57:59 Pass NULL directly?
112 DeleteHBitmapCallback, hbitmap);
112 } 113 }
113 114
114 // We use this static factory function instead of the regular constructor so 115 // We use this static factory function instead of the regular constructor so
115 // that we can create the pixel data before calling the constructor. This is 116 // that we can create the pixel data before calling the constructor. This is
116 // required so that we can call the base class' constructor with the pixel 117 // required so that we can call the base class' constructor with the pixel
117 // data. 118 // data.
118 BitmapPlatformDevice* BitmapPlatformDevice::Create( 119 BitmapPlatformDevice* BitmapPlatformDevice::Create(
119 int width, 120 int width,
120 int height, 121 int height,
121 bool is_opaque, 122 bool is_opaque,
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 platform_extra_ = reinterpret_cast<intptr_t>(stock_bitmap); 314 platform_extra_ = reinterpret_cast<intptr_t>(stock_bitmap);
314 315
315 if (!InstallHBitmapPixels(&bitmap_, width, height, is_opaque, data, hbitmap)) 316 if (!InstallHBitmapPixels(&bitmap_, width, height, is_opaque, data, hbitmap))
316 return false; 317 return false;
317 bitmap_.lockPixels(); 318 bitmap_.lockPixels();
318 319
319 return true; 320 return true;
320 } 321 }
321 322
322 } // namespace skia 323 } // namespace skia
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698