OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "services/ui/gles2/command_buffer_driver.h" | 5 #include "services/ui/gles2/command_buffer_driver.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "services/ui/gles2/gpu_state.h" | 28 #include "services/ui/gles2/gpu_state.h" |
29 #include "ui/gfx/buffer_format_util.h" | 29 #include "ui/gfx/buffer_format_util.h" |
30 #include "ui/gfx/gpu_memory_buffer.h" | 30 #include "ui/gfx/gpu_memory_buffer.h" |
31 #include "ui/gfx/vsync_provider.h" | 31 #include "ui/gfx/vsync_provider.h" |
32 #include "ui/gl/gl_context.h" | 32 #include "ui/gl/gl_context.h" |
33 #include "ui/gl/gl_image_shared_memory.h" | 33 #include "ui/gl/gl_image_shared_memory.h" |
34 #include "ui/gl/gl_surface.h" | 34 #include "ui/gl/gl_surface.h" |
35 #include "ui/gl/init/gl_factory.h" | 35 #include "ui/gl/init/gl_factory.h" |
36 | 36 |
37 #if defined(USE_OZONE) | 37 #if defined(USE_OZONE) |
38 #include "ui/gl/gl_image_ozone_native_pixmap.h" | 38 #include "ui/ozone/gl/gl_image_ozone_native_pixmap.h" |
39 #endif | 39 #endif |
40 | 40 |
41 namespace ui { | 41 namespace ui { |
42 | 42 |
43 namespace { | 43 namespace { |
44 | 44 |
45 // The first time polling a fence, delay some extra time to allow other | 45 // The first time polling a fence, delay some extra time to allow other |
46 // stubs to process some work, or else the timing of the fences could | 46 // stubs to process some work, or else the timing of the fences could |
47 // allow a pattern of alternating fast and slow frames to occur. | 47 // allow a pattern of alternating fast and slow frames to occur. |
48 const int64_t kHandleMoreWorkPeriodMs = 2; | 48 const int64_t kHandleMoreWorkPeriodMs = 2; |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 gfx::BufferFormat format, | 295 gfx::BufferFormat format, |
296 uint32_t internal_format, | 296 uint32_t internal_format, |
297 ui::NativePixmap* pixmap) { | 297 ui::NativePixmap* pixmap) { |
298 #if defined(USE_OZONE) | 298 #if defined(USE_OZONE) |
299 gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager(); | 299 gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager(); |
300 if (image_manager->LookupImage(id)) { | 300 if (image_manager->LookupImage(id)) { |
301 LOG(ERROR) << "Image already exists with same ID."; | 301 LOG(ERROR) << "Image already exists with same ID."; |
302 return; | 302 return; |
303 } | 303 } |
304 | 304 |
305 scoped_refptr<gl::GLImageOzoneNativePixmap> image = | 305 scoped_refptr<ui::GLImageOzoneNativePixmap> image = |
306 new gl::GLImageOzoneNativePixmap(size, internal_format); | 306 new ui::GLImageOzoneNativePixmap(size, internal_format); |
307 if (!image->Initialize(pixmap, format)) { | 307 if (!image->Initialize(pixmap, format)) { |
308 NOTREACHED(); | 308 NOTREACHED(); |
309 return; | 309 return; |
310 } | 310 } |
311 | 311 |
312 image_manager->AddImage(image.get(), id); | 312 image_manager->AddImage(image.get(), id); |
313 #endif | 313 #endif |
314 } | 314 } |
315 | 315 |
316 void CommandBufferDriver::DestroyImage(int32_t id) { | 316 void CommandBufferDriver::DestroyImage(int32_t id) { |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 } | 559 } |
560 | 560 |
561 void CommandBufferDriver::OnGpuCompletedSwapBuffers(gfx::SwapResult result) { | 561 void CommandBufferDriver::OnGpuCompletedSwapBuffers(gfx::SwapResult result) { |
562 DCHECK(CalledOnValidThread()); | 562 DCHECK(CalledOnValidThread()); |
563 if (client_) { | 563 if (client_) { |
564 client_->OnGpuCompletedSwapBuffers(result); | 564 client_->OnGpuCompletedSwapBuffers(result); |
565 } | 565 } |
566 } | 566 } |
567 | 567 |
568 } // namespace ui | 568 } // namespace ui |
OLD | NEW |