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

Unified Diff: gpu/command_buffer/service/in_process_command_buffer.cc

Issue 22066002: Add FBO support in Android WebView (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address joth's comments Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/in_process_command_buffer.h ('k') | ui/gl/gl_surface_stub.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/in_process_command_buffer.cc
diff --git a/gpu/command_buffer/service/in_process_command_buffer.cc b/gpu/command_buffer/service/in_process_command_buffer.cc
index 25d57013f2e1dd83f5ace9309efbf1e3fb350ed3..9de7bf8f297f060036432781a79af8110d8693cf 100644
--- a/gpu/command_buffer/service/in_process_command_buffer.cc
+++ b/gpu/command_buffer/service/in_process_command_buffer.cc
@@ -32,7 +32,6 @@
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_image.h"
#include "ui/gl/gl_share_group.h"
-#include "ui/gl/gl_surface.h"
namespace gpu {
@@ -287,6 +286,7 @@ bool InProcessCommandBuffer::GetBufferChanged(int32 transfer_buffer_id) {
}
bool InProcessCommandBuffer::Initialize(
+ scoped_refptr<gfx::GLSurface> surface,
no sievers 2013/08/05 20:41:09 Hmm, this is dangerous. GLSurface is not RefCounte
boliu 2013/08/05 20:42:52 Bah...good point.
bool is_offscreen,
bool share_resources,
gfx::AcceleratedWidget window,
@@ -300,9 +300,8 @@ bool InProcessCommandBuffer::Initialize(
share_resources_ = share_resources;
context_lost_callback_ = WrapCallback(context_lost_callback);
share_group_id_ = share_group_id;
+ surface_ = surface;
- base::WaitableEvent completion(true, false);
- bool result = false;
base::Callback<bool(void)> init_task =
base::Bind(&InProcessCommandBuffer::InitializeOnGpuThread,
base::Unretained(this),
@@ -312,6 +311,9 @@ bool InProcessCommandBuffer::Initialize(
allowed_extensions,
attribs,
gpu_preference);
+
+ base::WaitableEvent completion(true, false);
+ bool result = false;
QueueTask(
base::Bind(&RunTaskWithResult<bool>, init_task, &result, &completion));
completion.Wait();
@@ -381,10 +383,12 @@ bool InProcessCommandBuffer::InitializeOnGpuThread(
decoder_->set_engine(gpu_scheduler_.get());
- if (is_offscreen)
- surface_ = gfx::GLSurface::CreateOffscreenGLSurface(size);
- else
- surface_ = gfx::GLSurface::CreateViewGLSurface(window);
+ if (!surface_) {
+ if (is_offscreen)
+ surface_ = gfx::GLSurface::CreateOffscreenGLSurface(size);
+ else
+ surface_ = gfx::GLSurface::CreateViewGLSurface(window);
+ }
if (!surface_.get()) {
LOG(ERROR) << "Could not create GLSurface.";
« no previous file with comments | « gpu/command_buffer/service/in_process_command_buffer.h ('k') | ui/gl/gl_surface_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698