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

Unified Diff: components/mus/surfaces/buffer_queue.h

Issue 1881793002: SurfacelessSurfaces for Mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix build Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/mus/surfaces/BUILD.gn ('k') | components/mus/surfaces/buffer_queue.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/surfaces/buffer_queue.h
diff --git a/content/browser/compositor/buffer_queue.h b/components/mus/surfaces/buffer_queue.h
similarity index 79%
copy from content/browser/compositor/buffer_queue.h
copy to components/mus/surfaces/buffer_queue.h
index 772501c52a508f1d98aedb71ad19bc24792b5a6c..8435611f74616bb23a24add410be77b9aa7dd69e 100644
--- a/content/browser/compositor/buffer_queue.h
+++ b/components/mus/surfaces/buffer_queue.h
@@ -1,9 +1,9 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
+// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_BROWSER_COMPOSITOR_BUFFER_QUEUE_H_
-#define CONTENT_BROWSER_COMPOSITOR_BUFFER_QUEUE_H_
+#ifndef COMPONENTS_MUS_SURFACES_BUFFER_QUEUE_H_
+#define COMPONENTS_MUS_SURFACES_BUFFER_QUEUE_H_
#include <stddef.h>
@@ -13,9 +13,10 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "content/common/content_export.h"
+#include "gpu/command_buffer/client/gles2_interface.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
+#include "ui/gfx/native_widget_types.h"
namespace cc {
class ContextProvider;
@@ -25,26 +26,23 @@ namespace gfx {
class GpuMemoryBuffer;
}
-namespace gpu {
-class GpuMemoryBufferManager;
-}
+class SkRegion;
-namespace content {
+namespace mus {
+class MojoGpuMemoryBufferManager;
class GLHelper;
// Provides a surface that manages its own buffers, backed by GpuMemoryBuffers
// created using CHROMIUM_gpu_memory_buffer_image. Double/triple buffering is
// implemented internally. Doublebuffering occurs if PageFlipComplete is called
// before the next BindFramebuffer call, otherwise it creates extra buffers.
-class CONTENT_EXPORT BufferQueue {
+class BufferQueue {
public:
BufferQueue(scoped_refptr<cc::ContextProvider> context_provider,
- unsigned int texture_target,
- unsigned int internalformat,
- GLHelper* gl_helper,
- gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
- int surface_id);
+ uint32_t texture_target,
+ uint32_t internalformat,
+ gfx::AcceleratedWidget widget);
virtual ~BufferQueue();
void Initialize();
@@ -62,10 +60,9 @@ class CONTENT_EXPORT BufferQueue {
unsigned int fbo() const { return fbo_; }
private:
- friend class BufferQueueTest;
friend class AllocatedSurface;
- struct CONTENT_EXPORT AllocatedSurface {
+ struct AllocatedSurface {
AllocatedSurface(BufferQueue* buffer_queue,
std::unique_ptr<gfx::GpuMemoryBuffer> buffer,
unsigned int texture,
@@ -92,6 +89,12 @@ class CONTENT_EXPORT BufferQueue {
void UpdateBufferDamage(const gfx::Rect& damage);
+ void CopySubBufferDamage(GLenum target,
+ GLuint texture,
+ GLuint previous_texture,
+ const SkRegion& new_damage,
+ const SkRegion& old_damage);
+
// Return a surface, available to be drawn into.
std::unique_ptr<AllocatedSurface> GetNextSurface();
@@ -100,6 +103,7 @@ class CONTENT_EXPORT BufferQueue {
gfx::Size size_;
scoped_refptr<cc::ContextProvider> context_provider_;
+
unsigned int fbo_;
size_t allocated_count_;
unsigned int texture_target_;
@@ -114,13 +118,11 @@ class CONTENT_EXPORT BufferQueue {
// These have been swapped but are not displayed yet. Entries of this deque
// may be nullptr, if they represent frames that have been destroyed.
std::deque<std::unique_ptr<AllocatedSurface>> in_flight_surfaces_;
- GLHelper* gl_helper_;
- gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_;
- int surface_id_;
+ gfx::AcceleratedWidget widget_;
DISALLOW_COPY_AND_ASSIGN(BufferQueue);
};
-} // namespace content
+} // namespace mus
-#endif // CONTENT_BROWSER_COMPOSITOR_BUFFER_QUEUE_H_
+#endif // COMPONENTS_MUS_SURFACES_BUFFER_QUEUE_H_
« no previous file with comments | « components/mus/surfaces/BUILD.gn ('k') | components/mus/surfaces/buffer_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698