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

Side by Side Diff: content/common/gpu/image_transport_surface_mac.cc

Issue 11227033: Move a bunch of code in content\common (as well as a few left in renderer) to the content namespace. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix cros Created 8 years, 2 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
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 #if defined(ENABLE_GPU) 5 #if defined(ENABLE_GPU)
6 6
7 #include "content/common/gpu/image_transport_surface.h" 7 #include "content/common/gpu/image_transport_surface.h"
8 8
9 #include "base/mac/scoped_cftyperef.h" 9 #include "base/mac/scoped_cftyperef.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "content/common/gpu/gpu_messages.h" 11 #include "content/common/gpu/gpu_messages.h"
12 #include "ui/gfx/native_widget_types.h" 12 #include "ui/gfx/native_widget_types.h"
13 #include "ui/gl/gl_bindings.h" 13 #include "ui/gl/gl_bindings.h"
14 #include "ui/gl/gl_context.h" 14 #include "ui/gl/gl_context.h"
15 #include "ui/gl/gl_implementation.h" 15 #include "ui/gl/gl_implementation.h"
16 #include "ui/gl/gl_surface_cgl.h" 16 #include "ui/gl/gl_surface_cgl.h"
17 #include "ui/surface/io_surface_support_mac.h" 17 #include "ui/surface/io_surface_support_mac.h"
18 18
19 namespace content {
19 namespace { 20 namespace {
20 21
21 // IOSurface dimensions will be rounded up to a multiple of this value in order 22 // IOSurface dimensions will be rounded up to a multiple of this value in order
22 // to reduce memory thrashing during resize. This must be a power of 2. 23 // to reduce memory thrashing during resize. This must be a power of 2.
23 const uint32 kIOSurfaceDimensionRoundup = 64; 24 const uint32 kIOSurfaceDimensionRoundup = 64;
24 25
25 int RoundUpSurfaceDimension(int number) { 26 int RoundUpSurfaceDimension(int number) {
26 DCHECK(number >= 0); 27 DCHECK(number >= 0);
27 // Cast into unsigned space for portable bitwise ops. 28 // Cast into unsigned space for portable bitwise ops.
28 uint32 unsigned_number = static_cast<uint32>(number); 29 uint32 unsigned_number = static_cast<uint32>(number);
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 default: 432 default:
432 NOTREACHED(); 433 NOTREACHED();
433 return NULL; 434 return NULL;
434 } 435 }
435 if (surface->Initialize()) 436 if (surface->Initialize())
436 return surface; 437 return surface;
437 else 438 else
438 return NULL; 439 return NULL;
439 } 440 }
440 441
442 } // namespace content
443
441 #endif // defined(USE_GPU) 444 #endif // defined(USE_GPU)
OLDNEW
« no previous file with comments | « content/common/gpu/image_transport_surface_linux.cc ('k') | content/common/gpu/image_transport_surface_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698