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

Unified Diff: content/browser/compositor/buffer_queue.h

Issue 571623003: Partial swap implementation for surfaceless (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: simplify some of the swap logic. verified works Created 6 years, 3 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 | « no previous file | content/browser/compositor/buffer_queue.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/compositor/buffer_queue.h
diff --git a/content/browser/compositor/buffer_queue.h b/content/browser/compositor/buffer_queue.h
index 2b6185cadcceb5b2b2d1561c9ad45ef9ca168ed1..85ef949ed7fdad3d0fb097ccf5be3fe7639abf81 100644
--- a/content/browser/compositor/buffer_queue.h
+++ b/content/browser/compositor/buffer_queue.h
@@ -9,7 +9,9 @@
#include <vector>
#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
#include "content/common/content_export.h"
+#include "ui/gfx/rect.h"
#include "ui/gfx/size.h"
namespace cc {
@@ -26,12 +28,12 @@ class CONTENT_EXPORT BufferQueue {
public:
BufferQueue(scoped_refptr<cc::ContextProvider> context_provider,
unsigned int internalformat);
- ~BufferQueue();
+ virtual ~BufferQueue();
bool Initialize();
void BindFramebuffer();
- void SwapBuffers();
+ void SwapBuffers(const gfx::Rect& damage);
void PageFlipComplete();
void Reshape(const gfx::Size& size, float scale_factor);
@@ -39,18 +41,31 @@ class CONTENT_EXPORT BufferQueue {
private:
friend class BufferQueueTest;
+
struct AllocatedSurface {
AllocatedSurface() : texture(0), image(0) {}
- AllocatedSurface(unsigned int texture, unsigned int image)
- : texture(texture), image(image) {}
+ AllocatedSurface(unsigned int texture,
+ unsigned int image,
+ const gfx::Rect& rect)
+ : texture(texture), image(image), damage(rect) {}
unsigned int texture;
unsigned int image;
+ gfx::Rect damage; // This is the damage for this frame from the previous.
};
void FreeAllSurfaces();
void FreeSurface(AllocatedSurface* surface);
+ // Copy everything that is in |copy_rect|, except for what is in
+ // |exclude_rect| from |source_texture| to |texture|.
+ virtual void CopyBufferDamage(int texture,
+ int source_texture,
+ const gfx::Rect& new_damage,
+ const gfx::Rect& old_damage);
+
+ void UpdateBufferDamage(const gfx::Rect& damage);
+
// Return a surface, available to be drawn into.
AllocatedSurface GetNextSurface();
@@ -61,7 +76,7 @@ class CONTENT_EXPORT BufferQueue {
unsigned int internalformat_;
AllocatedSurface current_surface_; // This surface is currently bound.
std::vector<AllocatedSurface> available_surfaces_; // These are free for use.
- std::queue<AllocatedSurface> in_flight_surfaces_;
+ std::deque<AllocatedSurface> in_flight_surfaces_;
DISALLOW_COPY_AND_ASSIGN(BufferQueue);
};
« 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