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

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

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, 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/compositor/buffer_queue.cc
diff --git a/content/browser/compositor/buffer_queue.cc b/content/browser/compositor/buffer_queue.cc
index e22ec38d5867b827f769890f045563537ffbbc64..b9b750ac2db96dd11d962850920bab6fb1e23114 100644
--- a/content/browser/compositor/buffer_queue.cc
+++ b/content/browser/compositor/buffer_queue.cc
@@ -218,7 +218,7 @@ BufferQueue::AllocatedSurface BufferQueue::GetNextSurface() {
size_, gpu::ImageFactory::DefaultBufferFormatForImageFormat(
internal_format_),
surface_id_));
- if (!buffer) {
+ if (!buffer.get()) {
gl->DeleteTextures(1, &texture);
DLOG(ERROR) << "Failed to allocate GPU memory buffer";
return AllocatedSurface();
@@ -236,7 +236,18 @@ BufferQueue::AllocatedSurface BufferQueue::GetNextSurface() {
allocated_count_++;
gl->BindTexture(texture_target_, texture);
gl->BindTexImage2DCHROMIUM(texture_target_, id);
- return AllocatedSurface(texture, id, gfx::Rect(size_));
+ return AllocatedSurface(buffer.Pass(), texture, id, gfx::Rect(size_));
}
+BufferQueue::AllocatedSurface::AllocatedSurface() : texture(0), image(0) {}
+
+BufferQueue::AllocatedSurface::AllocatedSurface(
+ scoped_ptr<gfx::GpuMemoryBuffer> buffer,
+ unsigned int texture,
+ unsigned int image,
+ const gfx::Rect& rect)
+ : buffer(buffer.release()), texture(texture), image(image), damage(rect) {}
+
+BufferQueue::AllocatedSurface::~AllocatedSurface() {}
+
} // namespace content
« no previous file with comments | « content/browser/compositor/buffer_queue.h ('k') | content/browser/compositor/gpu_process_transport_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698