OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ |
6 #define CONTENT_RENDERER_GPU_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "content/renderer/gpu/renderer_gl_context.h" | 14 #include "content/common/gpu/client/content_gl_context.h" |
15 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
16 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGraphicsC
ontext3D.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGraphicsC
ontext3D.h" |
17 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | 17 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
19 #include "ui/gfx/gl/gpu_preference.h" | 19 #include "ui/gfx/gl/gpu_preference.h" |
20 #include "ui/gfx/native_widget_types.h" | 20 #include "ui/gfx/native_widget_types.h" |
21 | 21 |
22 #if defined(USE_SKIA) | 22 #if defined(USE_SKIA) |
23 #define FLIP_FRAMEBUFFER_VERTICALLY | 23 #define FLIP_FRAMEBUFFER_VERTICALLY |
24 #endif | 24 #endif |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 virtual void blitFramebufferCHROMIUM( | 450 virtual void blitFramebufferCHROMIUM( |
451 WGC3Dint srcX0, WGC3Dint srcY0, WGC3Dint srcX1, WGC3Dint srcY1, | 451 WGC3Dint srcX0, WGC3Dint srcY0, WGC3Dint srcX1, WGC3Dint srcY1, |
452 WGC3Dint dstX0, WGC3Dint dstY0, WGC3Dint dstX1, WGC3Dint dstY1, | 452 WGC3Dint dstX0, WGC3Dint dstY0, WGC3Dint dstX1, WGC3Dint dstY1, |
453 WGC3Dbitfield mask, WGC3Denum filter); | 453 WGC3Dbitfield mask, WGC3Denum filter); |
454 virtual void renderbufferStorageMultisampleCHROMIUM( | 454 virtual void renderbufferStorageMultisampleCHROMIUM( |
455 WGC3Denum target, WGC3Dsizei samples, WGC3Denum internalformat, | 455 WGC3Denum target, WGC3Dsizei samples, WGC3Denum internalformat, |
456 WGC3Dsizei width, WGC3Dsizei height); | 456 WGC3Dsizei width, WGC3Dsizei height); |
457 | 457 |
458 virtual WebKit::WebString getTranslatedShaderSourceANGLE(WebGLId shader); | 458 virtual WebKit::WebString getTranslatedShaderSourceANGLE(WebGLId shader); |
459 | 459 |
460 RendererGLContext* context() { return context_; } | 460 ContentGLContext* context() { return context_; } |
461 | 461 |
462 virtual void setContextLostCallback( | 462 virtual void setContextLostCallback( |
463 WebGraphicsContext3D::WebGraphicsContextLostCallback* callback); | 463 WebGraphicsContext3D::WebGraphicsContextLostCallback* callback); |
464 virtual WGC3Denum getGraphicsResetStatusARB(); | 464 virtual WGC3Denum getGraphicsResetStatusARB(); |
465 | 465 |
466 virtual void setSwapBuffersCompleteCallbackCHROMIUM( | 466 virtual void setSwapBuffersCompleteCallbackCHROMIUM( |
467 WebGraphicsContext3D:: | 467 WebGraphicsContext3D:: |
468 WebGraphicsSwapBuffersCompleteCallbackCHROMIUM* callback); | 468 WebGraphicsSwapBuffersCompleteCallbackCHROMIUM* callback); |
469 | 469 |
470 virtual void texImageIOSurface2DCHROMIUM( | 470 virtual void texImageIOSurface2DCHROMIUM( |
(...skipping 11 matching lines...) Expand all Loading... |
482 | 482 |
483 private: | 483 private: |
484 // Initialize the underlying GL context. May be called multiple times; second | 484 // Initialize the underlying GL context. May be called multiple times; second |
485 // and subsequent calls are ignored. Must be called from the thread that is | 485 // and subsequent calls are ignored. Must be called from the thread that is |
486 // going to use this object to issue GL commands (which might not be the main | 486 // going to use this object to issue GL commands (which might not be the main |
487 // thread). | 487 // thread). |
488 bool MaybeInitializeGL(); | 488 bool MaybeInitializeGL(); |
489 | 489 |
490 // SwapBuffers callback. | 490 // SwapBuffers callback. |
491 void OnSwapBuffersComplete(); | 491 void OnSwapBuffersComplete(); |
492 virtual void OnContextLost(RendererGLContext::ContextLostReason reason); | 492 virtual void OnContextLost(ContentGLContext::ContextLostReason reason); |
493 | 493 |
494 bool initialize_failed_; | 494 bool initialize_failed_; |
495 | 495 |
496 // The context we use for OpenGL rendering. | 496 // The context we use for OpenGL rendering. |
497 RendererGLContext* context_; | 497 ContentGLContext* context_; |
498 // The GLES2Implementation we use for OpenGL rendering. | 498 // The GLES2Implementation we use for OpenGL rendering. |
499 gpu::gles2::GLES2Implementation* gl_; | 499 gpu::gles2::GLES2Implementation* gl_; |
500 | 500 |
501 // State needed by MaybeInitializeGL. | 501 // State needed by MaybeInitializeGL. |
502 GpuChannelHost* host_; | 502 GpuChannelHost* host_; |
503 int32 surface_id_; | 503 int32 surface_id_; |
504 GURL active_url_; | 504 GURL active_url_; |
505 base::WeakPtr<WebGraphicsContext3DSwapBuffersClient> swap_client_; | 505 base::WeakPtr<WebGraphicsContext3DSwapBuffersClient> swap_client_; |
506 | 506 |
507 WebGraphicsContext3D::WebGraphicsContextLostCallback* context_lost_callback_; | 507 WebGraphicsContext3D::WebGraphicsContextLostCallback* context_lost_callback_; |
(...skipping 15 matching lines...) Expand all Loading... |
523 base::WeakPtrFactory<WebGraphicsContext3DCommandBufferImpl> weak_ptr_factory_; | 523 base::WeakPtrFactory<WebGraphicsContext3DCommandBufferImpl> weak_ptr_factory_; |
524 | 524 |
525 #ifdef FLIP_FRAMEBUFFER_VERTICALLY | 525 #ifdef FLIP_FRAMEBUFFER_VERTICALLY |
526 scoped_array<uint8> scanline_; | 526 scoped_array<uint8> scanline_; |
527 void FlipVertically(uint8* framebuffer, | 527 void FlipVertically(uint8* framebuffer, |
528 unsigned int width, | 528 unsigned int width, |
529 unsigned int height); | 529 unsigned int height); |
530 #endif | 530 #endif |
531 }; | 531 }; |
532 | 532 |
533 #endif // CONTENT_RENDERER_GPU_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ | 533 #endif // CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ |
OLD | NEW |