| 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/common/gpu/image_transport_surface_calayer_mac.h" | 5 #include "content/common/gpu/image_transport_surface_calayer_mac.h" |
| 6 | 6 |
| 7 #include <OpenGL/CGLRenderers.h> | 7 #include <OpenGL/CGLRenderers.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/mac/sdk_forward_declarations.h" | 10 #include "base/mac/sdk_forward_declarations.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 GL_RGBA, | 124 GL_RGBA, |
| 125 GL_UNSIGNED_BYTE, | 125 GL_UNSIGNED_BYTE, |
| 126 NULL); | 126 NULL); |
| 127 error = glGetError(); | 127 error = glGetError(); |
| 128 if (error != GL_NO_ERROR) { | 128 if (error != GL_NO_ERROR) { |
| 129 DLOG(ERROR) << "glTexImage failed with GL error: " << error; | 129 DLOG(ERROR) << "glTexImage failed with GL error: " << error; |
| 130 return false; | 130 return false; |
| 131 } | 131 } |
| 132 glFlush(); | 132 glFlush(); |
| 133 | 133 |
| 134 // Disable the fade-in animation as the layer is changed. | |
| 135 ScopedCAActionDisabler disabler; | |
| 136 | |
| 137 // Set the parameters that will be used to allocate the CALayer to draw the | 134 // Set the parameters that will be used to allocate the CALayer to draw the |
| 138 // texture into. | 135 // texture into. |
| 139 share_group_context_.reset(CGLRetainContext(context)); | 136 share_group_context_.reset(CGLRetainContext(context)); |
| 140 fbo_texture_ = texture; | 137 fbo_texture_ = texture; |
| 141 fbo_pixel_size_ = pixel_size; | 138 fbo_pixel_size_ = pixel_size; |
| 142 fbo_scale_factor_ = scale_factor; | 139 fbo_scale_factor_ = scale_factor; |
| 143 return true; | 140 return true; |
| 144 } | 141 } |
| 145 | 142 |
| 146 void CALayerStorageProvider::FreeColorBufferStorage() { | 143 void CALayerStorageProvider::FreeColorBufferStorage() { |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 return; | 317 return; |
| 321 pending_draw_weak_factory_.InvalidateWeakPtrs(); | 318 pending_draw_weak_factory_.InvalidateWeakPtrs(); |
| 322 has_pending_draw_ = false; | 319 has_pending_draw_ = false; |
| 323 transport_surface_->SendSwapBuffers( | 320 transport_surface_->SendSwapBuffers( |
| 324 SurfaceHandleFromCAContextID([context_ contextId]), | 321 SurfaceHandleFromCAContextID([context_ contextId]), |
| 325 fbo_pixel_size_, | 322 fbo_pixel_size_, |
| 326 fbo_scale_factor_); | 323 fbo_scale_factor_); |
| 327 } | 324 } |
| 328 | 325 |
| 329 } // namespace content | 326 } // namespace content |
| OLD | NEW |