Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(963)

Side by Side Diff: content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h

Issue 7713015: Split WebGraphicsContext3DCommandBufferImpl::initialize() into two stages. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Rebased, noted WebKit dependencies Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #ifndef CONTENT_RENDERER_GPU_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ 5 #ifndef CONTENT_RENDERER_GPU_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_
6 #define CONTENT_RENDERER_GPU_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ 6 #define CONTENT_RENDERER_GPU_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_
7 #pragma once 7 #pragma once
8 8
9 #if defined(ENABLE_GPU) 9 #if defined(ENABLE_GPU)
10 10
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "content/renderer/gpu/renderer_gl_context.h" 14 #include "content/renderer/gpu/renderer_gl_context.h"
15 #include "googleurl/src/gurl.h"
15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebGraphicsContext3D. h" 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebGraphicsContext3D. h"
16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
18 #include "ui/gfx/native_widget_types.h" 19 #include "ui/gfx/native_widget_types.h"
19 20
20 #if !defined(OS_MACOSX) 21 #if !defined(OS_MACOSX)
21 #define FLIP_FRAMEBUFFER_VERTICALLY 22 #define FLIP_FRAMEBUFFER_VERTICALLY
22 #endif 23 #endif
23 24
24 class GpuChannelHost; 25 class GpuChannelHost;
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 425
425 virtual void setContextLostCallback( 426 virtual void setContextLostCallback(
426 WebGraphicsContext3D::WebGraphicsContextLostCallback* callback); 427 WebGraphicsContext3D::WebGraphicsContextLostCallback* callback);
427 virtual WGC3Denum getGraphicsResetStatusARB(); 428 virtual WGC3Denum getGraphicsResetStatusARB();
428 429
429 virtual void setSwapBuffersCompleteCallbackCHROMIUM( 430 virtual void setSwapBuffersCompleteCallbackCHROMIUM(
430 WebGraphicsContext3D:: 431 WebGraphicsContext3D::
431 WebGraphicsSwapBuffersCompleteCallbackCHROMIUM* callback); 432 WebGraphicsSwapBuffersCompleteCallbackCHROMIUM* callback);
432 433
433 private: 434 private:
435 // Second stage init. Called from compositor thread via makeContextCurrent().
jamesr 2011/08/23 01:23:23 I'm not in love with this comment. It assumes a b
lain Merrick 2011/08/23 01:31:03 Sure, will do. I wanted *some* comment but kept it
436 bool InitializeGLES2();
nduca 2011/08/23 05:08:19 Any other names for this bikeshed? ;) InitializeC
lain Merrick 2011/08/24 19:52:05 I just went for InitializeGL. And on second though
437
434 // SwapBuffers callback. 438 // SwapBuffers callback.
435 void OnSwapBuffersComplete(); 439 void OnSwapBuffersComplete();
436 virtual void OnContextLost(RendererGLContext::ContextLostReason reason); 440 virtual void OnContextLost(RendererGLContext::ContextLostReason reason);
437 441
438 // The context we use for OpenGL rendering. 442 // The context we use for OpenGL rendering.
439 RendererGLContext* context_; 443 RendererGLContext* context_;
440 // The GLES2Implementation we use for OpenGL rendering. 444 // The GLES2Implementation we use for OpenGL rendering.
441 gpu::gles2::GLES2Implementation* gl_; 445 gpu::gles2::GLES2Implementation* gl_;
442 446
447 // State needed by InitializeGLES2.
448 GpuChannelHost* host_;
449 GURL active_url_;
450 int32 render_view_routing_id_;
451
443 bool render_directly_to_web_view_; 452 bool render_directly_to_web_view_;
444 #ifndef WTF_USE_THREADED_COMPOSITING 453 #ifndef WTF_USE_THREADED_COMPOSITING
445 // If rendering directly to WebView, weak pointer to it. 454 // If rendering directly to WebView, weak pointer to it.
446 WebKit::WebView* web_view_; 455 WebKit::WebView* web_view_;
447 #endif 456 #endif
448 #if defined(OS_MACOSX) 457 #if defined(OS_MACOSX)
449 // "Fake" plugin window handle in browser process for the compositor's output. 458 // "Fake" plugin window handle in browser process for the compositor's output.
450 gfx::PluginWindowHandle plugin_handle_; 459 gfx::PluginWindowHandle plugin_handle_;
451 #endif 460 #endif
452 WebGraphicsContext3D::WebGraphicsContextLostCallback* context_lost_callback_; 461 WebGraphicsContext3D::WebGraphicsContextLostCallback* context_lost_callback_;
(...skipping 14 matching lines...) Expand all
467 #ifdef FLIP_FRAMEBUFFER_VERTICALLY 476 #ifdef FLIP_FRAMEBUFFER_VERTICALLY
468 scoped_array<uint8> scanline_; 477 scoped_array<uint8> scanline_;
469 void FlipVertically(uint8* framebuffer, 478 void FlipVertically(uint8* framebuffer,
470 unsigned int width, 479 unsigned int width,
471 unsigned int height); 480 unsigned int height);
472 #endif 481 #endif
473 }; 482 };
474 483
475 #endif // defined(ENABLE_GPU) 484 #endif // defined(ENABLE_GPU)
476 #endif // CONTENT_RENDERER_GPU_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ 485 #endif // CONTENT_RENDERER_GPU_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698