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

Side by Side Diff: content/browser/compositor/buffer_queue.h

Issue 1416363002: Mac: Always use surfaceless mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add export Created 5 years, 1 month 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 | « no previous file | content/browser/compositor/buffer_queue.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 #ifndef CONTENT_BROWSER_COMPOSITOR_BUFFER_QUEUE_H_ 5 #ifndef CONTENT_BROWSER_COMPOSITOR_BUFFER_QUEUE_H_
6 #define CONTENT_BROWSER_COMPOSITOR_BUFFER_QUEUE_H_ 6 #define CONTENT_BROWSER_COMPOSITOR_BUFFER_QUEUE_H_
7 7
8 #include <queue> 8 #include <queue>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/memory/linked_ptr.h"
11 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
13 #include "content/common/content_export.h" 14 #include "content/common/content_export.h"
14 #include "ui/gfx/geometry/rect.h" 15 #include "ui/gfx/geometry/rect.h"
15 #include "ui/gfx/geometry/size.h" 16 #include "ui/gfx/geometry/size.h"
16 17
17 namespace cc { 18 namespace cc {
18 class ContextProvider; 19 class ContextProvider;
19 } 20 }
20 21
22 namespace gfx {
23 class GpuMemoryBuffer;
24 }
25
21 namespace content { 26 namespace content {
22 27
23 class BrowserGpuMemoryBufferManager; 28 class BrowserGpuMemoryBufferManager;
24 class GLHelper; 29 class GLHelper;
25 30
26 // Provides a surface that manages its own buffers, backed by GpuMemoryBuffers 31 // Provides a surface that manages its own buffers, backed by GpuMemoryBuffers
27 // created using CHROMIUM_gpu_memory_buffer_image. Double/triple buffering is 32 // created using CHROMIUM_gpu_memory_buffer_image. Double/triple buffering is
28 // implemented internally. Doublebuffering occurs if PageFlipComplete is called 33 // implemented internally. Doublebuffering occurs if PageFlipComplete is called
29 // before the next BindFramebuffer call, otherwise it creates extra buffers. 34 // before the next BindFramebuffer call, otherwise it creates extra buffers.
30 class CONTENT_EXPORT BufferQueue { 35 class CONTENT_EXPORT BufferQueue {
(...skipping 14 matching lines...) Expand all
45 void Reshape(const gfx::Size& size, float scale_factor); 50 void Reshape(const gfx::Size& size, float scale_factor);
46 51
47 void RecreateBuffers(); 52 void RecreateBuffers();
48 53
49 unsigned int current_texture_id() const { return current_surface_.texture; } 54 unsigned int current_texture_id() const { return current_surface_.texture; }
50 unsigned int fbo() const { return fbo_; } 55 unsigned int fbo() const { return fbo_; }
51 56
52 private: 57 private:
53 friend class BufferQueueTest; 58 friend class BufferQueueTest;
54 59
55 struct AllocatedSurface { 60 struct CONTENT_EXPORT AllocatedSurface {
56 AllocatedSurface() : texture(0), image(0) {} 61 AllocatedSurface();
57 AllocatedSurface(unsigned int texture, 62 AllocatedSurface(scoped_ptr<gfx::GpuMemoryBuffer> buffer,
63 unsigned int texture,
58 unsigned int image, 64 unsigned int image,
59 const gfx::Rect& rect) 65 const gfx::Rect& rect);
60 : texture(texture), image(image), damage(rect) {} 66 ~AllocatedSurface();
67 // TODO(ccameron): Change this to be a scoped_ptr, and change all use of
68 // AllocatedSurface to use scoped_ptr as well.
69 linked_ptr<gfx::GpuMemoryBuffer> buffer;
61 unsigned int texture; 70 unsigned int texture;
62 unsigned int image; 71 unsigned int image;
63 gfx::Rect damage; // This is the damage for this frame from the previous. 72 gfx::Rect damage; // This is the damage for this frame from the previous.
64 }; 73 };
65 74
66 void FreeAllSurfaces(); 75 void FreeAllSurfaces();
67 76
68 void FreeSurface(AllocatedSurface* surface); 77 void FreeSurface(AllocatedSurface* surface);
69 78
70 // Copy everything that is in |copy_rect|, except for what is in 79 // Copy everything that is in |copy_rect|, except for what is in
(...skipping 23 matching lines...) Expand all
94 GLHelper* gl_helper_; 103 GLHelper* gl_helper_;
95 BrowserGpuMemoryBufferManager* gpu_memory_buffer_manager_; 104 BrowserGpuMemoryBufferManager* gpu_memory_buffer_manager_;
96 int surface_id_; 105 int surface_id_;
97 106
98 DISALLOW_COPY_AND_ASSIGN(BufferQueue); 107 DISALLOW_COPY_AND_ASSIGN(BufferQueue);
99 }; 108 };
100 109
101 } // namespace content 110 } // namespace content
102 111
103 #endif // CONTENT_BROWSER_COMPOSITOR_BUFFER_QUEUE_H_ 112 #endif // CONTENT_BROWSER_COMPOSITOR_BUFFER_QUEUE_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/compositor/buffer_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698