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

Side by Side Diff: ui/ozone/platform/dri/dri_buffer.cc

Issue 361643002: setConfig is deprecated, use setInfo or allocPixels instead (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: don't call allocPixels+rowbytes yet (skia bug) Created 6 years, 5 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 | « ui/ozone/platform/caca/caca_surface_factory.cc ('k') | ui/ozone/platform/dri/dri_surface.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/ozone/platform/dri/dri_buffer.h" 5 #include "ui/ozone/platform/dri/dri_buffer.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <sys/mman.h> 8 #include <sys/mman.h>
9 #include <sys/types.h> 9 #include <sys/types.h>
10 #include <xf86drm.h> 10 #include <xf86drm.h>
(...skipping 13 matching lines...) Expand all
24 switch (type) { 24 switch (type) {
25 case kUnknown_SkColorType: 25 case kUnknown_SkColorType:
26 case kAlpha_8_SkColorType: 26 case kAlpha_8_SkColorType:
27 return 0; 27 return 0;
28 case kIndex_8_SkColorType: 28 case kIndex_8_SkColorType:
29 return 8; 29 return 8;
30 case kRGB_565_SkColorType: 30 case kRGB_565_SkColorType:
31 return 16; 31 return 16;
32 case kARGB_4444_SkColorType: 32 case kARGB_4444_SkColorType:
33 return 12; 33 return 12;
34 case kPMColor_SkColorType: 34 case kN32_SkColorType:
35 return 24; 35 return 24;
36 default: 36 default:
37 NOTREACHED(); 37 NOTREACHED();
38 return 0; 38 return 0;
39 } 39 }
40 } 40 }
41 41
42 void DestroyDumbBuffer(int fd, uint32_t handle) { 42 void DestroyDumbBuffer(int fd, uint32_t handle) {
43 struct drm_mode_destroy_dumb destroy_request; 43 struct drm_mode_destroy_dumb destroy_request;
44 destroy_request.handle = handle; 44 destroy_request.handle = handle;
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 surface_ = skia::AdoptRef(SkSurface::NewRasterDirect(info, pixels, stride_)); 122 surface_ = skia::AdoptRef(SkSurface::NewRasterDirect(info, pixels, stride_));
123 if (!surface_) { 123 if (!surface_) {
124 DLOG(ERROR) << "Cannot install Skia pixels for drm buffer"; 124 DLOG(ERROR) << "Cannot install Skia pixels for drm buffer";
125 return false; 125 return false;
126 } 126 }
127 127
128 return true; 128 return true;
129 } 129 }
130 130
131 } // namespace ui 131 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/caca/caca_surface_factory.cc ('k') | ui/ozone/platform/dri/dri_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698