| OLD | NEW |
| 1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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 "cc/output/gl_renderer.h" | 5 #include "cc/output/gl_renderer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 2228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2239 | 2239 |
| 2240 if (!request->force_bitmap_result()) { | 2240 if (!request->force_bitmap_result()) { |
| 2241 bool own_mailbox = !request->has_texture_mailbox(); | 2241 bool own_mailbox = !request->has_texture_mailbox(); |
| 2242 | 2242 |
| 2243 GLuint texture_id = 0; | 2243 GLuint texture_id = 0; |
| 2244 gl_->GenTextures(1, &texture_id); | 2244 gl_->GenTextures(1, &texture_id); |
| 2245 | 2245 |
| 2246 gpu::Mailbox mailbox; | 2246 gpu::Mailbox mailbox; |
| 2247 if (own_mailbox) { | 2247 if (own_mailbox) { |
| 2248 GLC(gl_, gl_->GenMailboxCHROMIUM(mailbox.name)); | 2248 GLC(gl_, gl_->GenMailboxCHROMIUM(mailbox.name)); |
| 2249 if (mailbox.IsZero()) { | |
| 2250 gl_->DeleteTextures(1, &texture_id); | |
| 2251 request->SendEmptyResult(); | |
| 2252 return; | |
| 2253 } | |
| 2254 } else { | 2249 } else { |
| 2255 mailbox = request->texture_mailbox().mailbox(); | 2250 mailbox = request->texture_mailbox().mailbox(); |
| 2256 DCHECK_EQ(static_cast<unsigned>(GL_TEXTURE_2D), | 2251 DCHECK_EQ(static_cast<unsigned>(GL_TEXTURE_2D), |
| 2257 request->texture_mailbox().target()); | 2252 request->texture_mailbox().target()); |
| 2258 DCHECK(!mailbox.IsZero()); | 2253 DCHECK(!mailbox.IsZero()); |
| 2259 unsigned incoming_sync_point = request->texture_mailbox().sync_point(); | 2254 unsigned incoming_sync_point = request->texture_mailbox().sync_point(); |
| 2260 if (incoming_sync_point) | 2255 if (incoming_sync_point) |
| 2261 GLC(gl_, gl_->WaitSyncPointCHROMIUM(incoming_sync_point)); | 2256 GLC(gl_, gl_->WaitSyncPointCHROMIUM(incoming_sync_point)); |
| 2262 } | 2257 } |
| 2263 | 2258 |
| (...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3042 is_scissor_enabled_ = false; | 3037 is_scissor_enabled_ = false; |
| 3043 GLC(gl_, gl_->Disable(GL_SCISSOR_TEST)); | 3038 GLC(gl_, gl_->Disable(GL_SCISSOR_TEST)); |
| 3044 scissor_rect_needs_reset_ = true; | 3039 scissor_rect_needs_reset_ = true; |
| 3045 } | 3040 } |
| 3046 | 3041 |
| 3047 bool GLRenderer::IsContextLost() { | 3042 bool GLRenderer::IsContextLost() { |
| 3048 return output_surface_->context_provider()->IsContextLost(); | 3043 return output_surface_->context_provider()->IsContextLost(); |
| 3049 } | 3044 } |
| 3050 | 3045 |
| 3051 } // namespace cc | 3046 } // namespace cc |
| OLD | NEW |