OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/renderer/renderer_gl_context.h" | 5 #include "content/renderer/renderer_gl_context.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 } | 369 } |
370 | 370 |
371 bool RendererGLContext::Initialize(bool onscreen, | 371 bool RendererGLContext::Initialize(bool onscreen, |
372 gfx::PluginWindowHandle render_surface, | 372 gfx::PluginWindowHandle render_surface, |
373 int render_view_id, | 373 int render_view_id, |
374 const gfx::Size& size, | 374 const gfx::Size& size, |
375 const char* allowed_extensions, | 375 const char* allowed_extensions, |
376 const int32* attrib_list, | 376 const int32* attrib_list, |
377 const GURL& active_url) { | 377 const GURL& active_url) { |
378 DCHECK(size.width() >= 0 && size.height() >= 0); | 378 DCHECK(size.width() >= 0 && size.height() >= 0); |
379 GPU_TRACE_EVENT0("gpu", "RendererGLContext::Initialize"); | 379 GPU_TRACE_EVENT2("gpu", "RendererGLContext::Initialize", |
| 380 "on_screen", onscreen, "num_pixels", size.GetArea()); |
380 | 381 |
381 if (channel_->state() != GpuChannelHost::kConnected) | 382 if (channel_->state() != GpuChannelHost::kConnected) |
382 return false; | 383 return false; |
383 | 384 |
384 // Ensure the gles2 library is initialized first in a thread safe way. | 385 // Ensure the gles2 library is initialized first in a thread safe way. |
385 g_gles2_initializer.Get(); | 386 g_gles2_initializer.Get(); |
386 | 387 |
387 // Allocate a frame buffer ID with respect to the parent. | 388 // Allocate a frame buffer ID with respect to the parent. |
388 if (parent_.get()) { | 389 if (parent_.get()) { |
389 // Flush any remaining commands in the parent context to make sure the | 390 // Flush any remaining commands in the parent context to make sure the |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 } | 586 } |
586 | 587 |
587 bool RendererGLContext::GetChildToParentLatch(uint32* child_to_parent_latch) { | 588 bool RendererGLContext::GetChildToParentLatch(uint32* child_to_parent_latch) { |
588 if (parent_.get()) { | 589 if (parent_.get()) { |
589 *child_to_parent_latch = child_to_parent_latch_; | 590 *child_to_parent_latch = child_to_parent_latch_; |
590 return true; | 591 return true; |
591 } | 592 } |
592 return false; | 593 return false; |
593 } | 594 } |
594 | 595 |
OLD | NEW |