#include "content/browser/compositor/reflector_impl.h"
#include "content/browser/gpu/gpu_surface_tracker.h"
#include "content/common/gpu/client/context_provider_command_buffer.h"
+#include "content/common/gpu/client/gl_helper.h"
#include "gpu/GLES2/gl2extchromium.h"
#include "gpu/command_buffer/client/gles2_interface.h"
IDMap<BrowserCompositorOutputSurface>* output_surface_map,
const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager,
scoped_ptr<cc::OverlayCandidateValidator> overlay_candidate_validator,
- unsigned internalformat)
+ unsigned internalformat,
+ bool use_own_gl_helper)
: GpuBrowserCompositorOutputSurface(context,
surface_id,
output_surface_map,
vsync_manager,
overlay_candidate_validator.Pass()),
- internalformat_(internalformat) {
+ internalformat_(internalformat),
+ use_own_gl_helper_(use_own_gl_helper) {
+ capabilities_.uses_default_gl_framebuffer = false;
+ capabilities_.flipped_output_surface = true;
}
GpuSurfacelessBrowserCompositorOutputSurface::
cc::OutputSurfaceClient* client) {
if (!GpuBrowserCompositorOutputSurface::BindToClient(client))
return false;
- output_surface_.reset(new BufferQueue(context_provider_, internalformat_));
+ GLHelper* helper;
+ if (use_own_gl_helper_) {
+ gl_helper_.reset(new GLHelper(context_provider_->ContextGL(),
+ context_provider_->ContextSupport()));
+ helper = gl_helper_.get();
+ } else {
+ helper = ImageTransportFactory::GetInstance()->GetGLHelper();
+ }
+ output_surface_.reset(
+ new BufferQueue(context_provider_, internalformat_, helper));
return output_surface_->Initialize();
}