| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 gpu::gles2::GLES2Interface* gl = contextGL(); | 304 gpu::gles2::GLES2Interface* gl = contextGL(); |
| 305 if (!gl) | 305 if (!gl) |
| 306 return nullptr; | 306 return nullptr; |
| 307 | 307 |
| 308 gpu::GpuMemoryBufferManager* gpuMemoryBufferManager = | 308 gpu::GpuMemoryBufferManager* gpuMemoryBufferManager = |
| 309 Platform::current()->getGpuMemoryBufferManager(); | 309 Platform::current()->getGpuMemoryBufferManager(); |
| 310 if (!gpuMemoryBufferManager) | 310 if (!gpuMemoryBufferManager) |
| 311 return nullptr; | 311 return nullptr; |
| 312 | 312 |
| 313 std::unique_ptr<gfx::GpuMemoryBuffer> gpuMemoryBuffer = | 313 std::unique_ptr<gfx::GpuMemoryBuffer> gpuMemoryBuffer = |
| 314 gpuMemoryBufferManager->AllocateGpuMemoryBuffer( | 314 gpuMemoryBufferManager->CreateGpuMemoryBuffer( |
| 315 gfx::Size(m_size), gfx::BufferFormat::RGBA_8888, | 315 gfx::Size(m_size), gfx::BufferFormat::RGBA_8888, |
| 316 gfx::BufferUsage::SCANOUT, gpu::kNullSurfaceHandle); | 316 gfx::BufferUsage::SCANOUT, gpu::kNullSurfaceHandle); |
| 317 if (!gpuMemoryBuffer) | 317 if (!gpuMemoryBuffer) |
| 318 return nullptr; | 318 return nullptr; |
| 319 | 319 |
| 320 GLuint imageId = | 320 GLuint imageId = |
| 321 gl->CreateImageCHROMIUM(gpuMemoryBuffer->AsClientBuffer(), m_size.width(), | 321 gl->CreateImageCHROMIUM(gpuMemoryBuffer->AsClientBuffer(), m_size.width(), |
| 322 m_size.height(), GL_RGBA); | 322 m_size.height(), GL_RGBA); |
| 323 if (!imageId) | 323 if (!imageId) |
| 324 return nullptr; | 324 return nullptr; |
| (...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1137 default; | 1137 default; |
| 1138 | 1138 |
| 1139 void Canvas2DLayerBridge::Logger::reportHibernationEvent( | 1139 void Canvas2DLayerBridge::Logger::reportHibernationEvent( |
| 1140 HibernationEvent event) { | 1140 HibernationEvent event) { |
| 1141 DEFINE_STATIC_LOCAL(EnumerationHistogram, hibernationHistogram, | 1141 DEFINE_STATIC_LOCAL(EnumerationHistogram, hibernationHistogram, |
| 1142 ("Canvas.HibernationEvents", HibernationEventCount)); | 1142 ("Canvas.HibernationEvents", HibernationEventCount)); |
| 1143 hibernationHistogram.count(event); | 1143 hibernationHistogram.count(event); |
| 1144 } | 1144 } |
| 1145 | 1145 |
| 1146 } // namespace blink | 1146 } // namespace blink |
| OLD | NEW |