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

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

Issue 1452943002: cc: Fix overlay damage tracking bug (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add buffer queue update 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 | « cc/output/overlay_unittest.cc ('k') | no next file » | 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 #include "content/browser/compositor/buffer_queue.h" 5 #include "content/browser/compositor/buffer_queue.h"
6 6
7 #include "content/browser/compositor/image_transport_factory.h" 7 #include "content/browser/compositor/image_transport_factory.h"
8 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" 8 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h"
9 #include "content/common/gpu/client/context_provider_command_buffer.h" 9 #include "content/common/gpu/client/context_provider_command_buffer.h"
10 #include "content/common/gpu/client/gl_helper.h" 10 #include "content/common/gpu/client/gl_helper.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 available_surfaces_[i].damage.Union(damage); 74 available_surfaces_[i].damage.Union(damage);
75 75
76 for (std::deque<AllocatedSurface>::iterator it = 76 for (std::deque<AllocatedSurface>::iterator it =
77 in_flight_surfaces_.begin(); 77 in_flight_surfaces_.begin();
78 it != in_flight_surfaces_.end(); 78 it != in_flight_surfaces_.end();
79 ++it) 79 ++it)
80 it->damage.Union(damage); 80 it->damage.Union(damage);
81 } 81 }
82 82
83 void BufferQueue::SwapBuffers(const gfx::Rect& damage) { 83 void BufferQueue::SwapBuffers(const gfx::Rect& damage) {
84 if (damage != gfx::Rect(size_)) { 84 if (!damage.IsEmpty() && damage != gfx::Rect(size_)) {
85 // We must have a frame available to copy from. 85 // We must have a frame available to copy from.
86 DCHECK(!in_flight_surfaces_.empty() || displayed_surface_.texture); 86 DCHECK(!in_flight_surfaces_.empty() || displayed_surface_.texture);
87 unsigned int texture_id = !in_flight_surfaces_.empty() 87 unsigned int texture_id = !in_flight_surfaces_.empty()
88 ? in_flight_surfaces_.back().texture 88 ? in_flight_surfaces_.back().texture
89 : displayed_surface_.texture; 89 : displayed_surface_.texture;
90 90
91 CopyBufferDamage(current_surface_.texture, texture_id, damage, 91 CopyBufferDamage(current_surface_.texture, texture_id, damage,
92 current_surface_.damage); 92 current_surface_.damage);
93 } 93 }
94 UpdateBufferDamage(damage); 94 UpdateBufferDamage(damage);
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 BufferQueue::AllocatedSurface::AllocatedSurface( 244 BufferQueue::AllocatedSurface::AllocatedSurface(
245 scoped_ptr<gfx::GpuMemoryBuffer> buffer, 245 scoped_ptr<gfx::GpuMemoryBuffer> buffer,
246 unsigned int texture, 246 unsigned int texture,
247 unsigned int image, 247 unsigned int image,
248 const gfx::Rect& rect) 248 const gfx::Rect& rect)
249 : buffer(buffer.release()), texture(texture), image(image), damage(rect) {} 249 : buffer(buffer.release()), texture(texture), image(image), damage(rect) {}
250 250
251 BufferQueue::AllocatedSurface::~AllocatedSurface() {} 251 BufferQueue::AllocatedSurface::~AllocatedSurface() {}
252 252
253 } // namespace content 253 } // namespace content
OLDNEW
« no previous file with comments | « cc/output/overlay_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698