Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 texture, | 68 texture, |
| 69 source_texture, | 69 source_texture, |
| 70 SkRegion(SkIRect::MakeXYWH(new_damage.x(), | 70 SkRegion(SkIRect::MakeXYWH(new_damage.x(), |
| 71 new_damage.y(), | 71 new_damage.y(), |
| 72 new_damage.width(), | 72 new_damage.width(), |
| 73 new_damage.height())), | 73 new_damage.height())), |
| 74 SkRegion(SkIRect::MakeXYWH(old_damage.x(), | 74 SkRegion(SkIRect::MakeXYWH(old_damage.x(), |
| 75 old_damage.y(), | 75 old_damage.y(), |
| 76 old_damage.width(), | 76 old_damage.width(), |
| 77 old_damage.height()))); | 77 old_damage.height()))); |
| 78 // CopySubBufferDamage binds its own framebuffer, restore ours. | |
|
danakj
2015/01/12 18:27:30
Should this be a separate CL?
achaulk
2015/01/12 18:47:35
It could be, but SW mirroring with partial swap is
danakj
2015/01/12 19:00:07
It doesn't seem related to flipping tho? So It wou
| |
| 79 context_provider_->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, fbo_); | |
| 78 } | 80 } |
| 79 | 81 |
| 80 void BufferQueue::UpdateBufferDamage(const gfx::Rect& damage) { | 82 void BufferQueue::UpdateBufferDamage(const gfx::Rect& damage) { |
| 81 for (size_t i = 0; i < available_surfaces_.size(); i++) | 83 for (size_t i = 0; i < available_surfaces_.size(); i++) |
| 82 available_surfaces_[i].damage.Union(damage); | 84 available_surfaces_[i].damage.Union(damage); |
| 83 for (std::deque<AllocatedSurface>::iterator it = | 85 for (std::deque<AllocatedSurface>::iterator it = |
| 84 in_flight_surfaces_.begin(); | 86 in_flight_surfaces_.begin(); |
| 85 it != in_flight_surfaces_.end(); | 87 it != in_flight_surfaces_.end(); |
| 86 ++it) | 88 ++it) |
| 87 it->damage.Union(damage); | 89 it->damage.Union(damage); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 179 gl->DeleteTextures(1, &texture); | 181 gl->DeleteTextures(1, &texture); |
| 180 return AllocatedSurface(); | 182 return AllocatedSurface(); |
| 181 } | 183 } |
| 182 allocated_count_++; | 184 allocated_count_++; |
| 183 gl->BindTexture(GL_TEXTURE_2D, texture); | 185 gl->BindTexture(GL_TEXTURE_2D, texture); |
| 184 gl->BindTexImage2DCHROMIUM(GL_TEXTURE_2D, id); | 186 gl->BindTexImage2DCHROMIUM(GL_TEXTURE_2D, id); |
| 185 return AllocatedSurface(texture, id, gfx::Rect(size_)); | 187 return AllocatedSurface(texture, id, gfx::Rect(size_)); |
| 186 } | 188 } |
| 187 | 189 |
| 188 } // namespace content | 190 } // namespace content |
| OLD | NEW |