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

Side by Side Diff: ui/gfx/ipc/gfx_param_traits.cc

Issue 1142113002: Remove SK_SUPPORT_LEGACY_PUBLIC_IMAGEINFO_FIELDS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 5 years, 7 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 | « ui/accelerated_widget_mac/accelerated_widget_mac.mm ('k') | ui/gfx/skbitmap_operations.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/gfx/ipc/gfx_param_traits.h" 5 #include "ui/gfx/ipc/gfx_param_traits.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "third_party/skia/include/core/SkBitmap.h" 9 #include "third_party/skia/include/core/SkBitmap.h"
10 #include "ui/gfx/geometry/rect.h" 10 #include "ui/gfx/geometry/rect.h"
(...skipping 10 matching lines...) Expand all
21 SkAlphaType fAlphaType; 21 SkAlphaType fAlphaType;
22 22
23 // The width of the bitmap in pixels. 23 // The width of the bitmap in pixels.
24 uint32 fWidth; 24 uint32 fWidth;
25 25
26 // The height of the bitmap in pixels. 26 // The height of the bitmap in pixels.
27 uint32 fHeight; 27 uint32 fHeight;
28 28
29 void InitSkBitmapDataForTransfer(const SkBitmap& bitmap) { 29 void InitSkBitmapDataForTransfer(const SkBitmap& bitmap) {
30 const SkImageInfo& info = bitmap.info(); 30 const SkImageInfo& info = bitmap.info();
31 fColorType = info.fColorType; 31 fColorType = info.colorType();
32 fAlphaType = info.fAlphaType; 32 fAlphaType = info.alphaType();
33 fWidth = info.fWidth; 33 fWidth = info.width();
34 fHeight = info.fHeight; 34 fHeight = info.height();
35 } 35 }
36 36
37 // Returns whether |bitmap| successfully initialized. 37 // Returns whether |bitmap| successfully initialized.
38 bool InitSkBitmapFromData(SkBitmap* bitmap, 38 bool InitSkBitmapFromData(SkBitmap* bitmap,
39 const char* pixels, 39 const char* pixels,
40 size_t pixels_size) const { 40 size_t pixels_size) const {
41 if (!bitmap->tryAllocPixels( 41 if (!bitmap->tryAllocPixels(
42 SkImageInfo::Make(fWidth, fHeight, fColorType, fAlphaType))) 42 SkImageInfo::Make(fWidth, fHeight, fColorType, fAlphaType)))
43 return false; 43 return false;
44 if (pixels_size != bitmap->getSize()) 44 if (pixels_size != bitmap->getSize())
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 r->set_end(end); 281 r->set_end(end);
282 return true; 282 return true;
283 } 283 }
284 284
285 void ParamTraits<gfx::Range>::Log(const gfx::Range& r, std::string* l) { 285 void ParamTraits<gfx::Range>::Log(const gfx::Range& r, std::string* l) {
286 l->append(base::StringPrintf("(%" PRIuS ", %" PRIuS ")", r.start(), r.end())); 286 l->append(base::StringPrintf("(%" PRIuS ", %" PRIuS ")", r.start(), r.end()));
287 } 287 }
288 288
289 289
290 } // namespace IPC 290 } // namespace IPC
OLDNEW
« no previous file with comments | « ui/accelerated_widget_mac/accelerated_widget_mac.mm ('k') | ui/gfx/skbitmap_operations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698