Skip to content

Commit

Permalink
Revert of Mandoline: Add WebGL support (patchset chromium#9 id:180001…
Browse files Browse the repository at this point in the history
… of https://codereview.chromium.org/1338433002/ )

Reason for revert:
Unfortunately, this broke `gn check` with an improper dependency.

http://build.chromium.org/p/chromium.linux/builders/Linux%20GN/builds/32063/steps/gn_check/logs/stdio

I have a patch in-flight that will re-enable gn check on the trybots so that this breakages don't get through, but in the meantime I'm reverting this.

Sorry!

Original issue's description:
> This change adds WebGL support in mandoline. It also adds GL
> chromium_framebuffer_multisample extension which is need by
> WebGL.
>
> TODO:
>   * Pass attributes to GPU when create WebGL context.
>   * Get GPU info and fill it into glinfo.
>
> TEST= mandoline --enable-webgl http://learningwebgl.com/lessons/lesson03/index.html
> BUG=525159
> NOPRESUBMIT=true
>
> Committed: https://crrev.com/ab7a90daddbe7d44558d8703b12204570ae98431
> Cr-Commit-Position: refs/heads/master@{#349206}

TBR=sky@chromium.org,piman@chromium.org,fsamuel@chromium.org,penghuang@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=525159

Review URL: https://codereview.chromium.org/1343303003

Cr-Commit-Position: refs/heads/master@{#349226}
  • Loading branch information
dpranke authored and Commit bot committed Sep 16, 2015
1 parent 3311ef8 commit c6374e2
Show file tree
Hide file tree
Showing 18 changed files with 7 additions and 352 deletions.
4 changes: 0 additions & 4 deletions components/html_viewer/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ source_set("lib") {
"web_clipboard_impl.h",
"web_cookie_jar_impl.cc",
"web_cookie_jar_impl.h",
"web_graphics_context_3d_command_buffer_impl.cc",
"web_graphics_context_3d_command_buffer_impl.h",
"web_layer_impl.cc",
"web_layer_impl.h",
"web_layer_tree_view_impl.cc",
Expand Down Expand Up @@ -159,7 +157,6 @@ source_set("lib") {
"//components/web_view:switches",
"//components/web_view/public/interfaces",
"//gin",
"//gpu/blink:blink",
"//media",
"//media/blink",
"//media/mojo",
Expand All @@ -168,7 +165,6 @@ source_set("lib") {
"//mojo/cc",
"//mojo/common",
"//mojo/converters/surfaces",
"//mojo/gles2:headers",
"//mojo/logging",
"//mojo/message_pump",
"//mojo/platform_handle",
Expand Down
3 changes: 0 additions & 3 deletions components/html_viewer/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,13 @@ include_rules = [
"+components/web_view/web_view_switches.cc",
"+components/web_view/web_view_switches.h",
"+gin",
"+gpu/blink/webgraphicscontext3d_impl.h",
"+mandoline/services",
"+media",
"+mojo/application",
"+mojo/cc",
"+mojo/common",
"+mojo/converters/geometry",
"+mojo/converters/surfaces",
"+mojo/gles2",
"+mojo/gpu",
"+mojo/logging",
"+mojo/message_pump",
"+mojo/platform_handle",
Expand Down
33 changes: 1 addition & 32 deletions components/html_viewer/blink_platform_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "components/html_viewer/blink_resource_constants.h"
#include "components/html_viewer/web_clipboard_impl.h"
#include "components/html_viewer/web_cookie_jar_impl.h"
#include "components/html_viewer/web_graphics_context_3d_command_buffer_impl.h"
#include "components/html_viewer/web_socket_handle_impl.h"
#include "components/html_viewer/web_url_loader_impl.h"
#include "components/message_port/web_message_port_channel_impl.h"
Expand All @@ -35,7 +34,6 @@
#include "third_party/WebKit/public/platform/WebWaitableEvent.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/events/gestures/blink/web_gesture_curve_impl.h"
#include "url/gurl.h"

namespace html_viewer {
namespace {
Expand Down Expand Up @@ -70,8 +68,7 @@ class WebWaitableEventImpl : public blink::WebWaitableEvent {
BlinkPlatformImpl::BlinkPlatformImpl(
mojo::ApplicationImpl* app,
scheduler::RendererScheduler* renderer_scheduler)
: app_(app),
main_thread_task_runner_(renderer_scheduler->DefaultTaskRunner()),
: main_thread_task_runner_(renderer_scheduler->DefaultTaskRunner()),
main_thread_(new scheduler::WebThreadImplForRendererScheduler(
renderer_scheduler)) {
if (app) {
Expand Down Expand Up @@ -165,34 +162,6 @@ const unsigned char* BlinkPlatformImpl::getTraceCategoryEnabledFlag(
return buf;
}

blink::WebGraphicsContext3D*
BlinkPlatformImpl::createOffscreenGraphicsContext3D(
const blink::WebGraphicsContext3D::Attributes& attributes,
blink::WebGraphicsContext3D* share_context) {
return createOffscreenGraphicsContext3D(attributes, share_context, nullptr);
}

blink::WebGraphicsContext3D*
BlinkPlatformImpl::createOffscreenGraphicsContext3D(
const blink::WebGraphicsContext3D::Attributes& attributes,
blink::WebGraphicsContext3D* share_context,
blink::WebGLInfo* gl_info) {
return WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext(
app_, GURL(attributes.topDocumentURL), attributes, share_context,
gl_info);
}

blink::WebGraphicsContext3D*
BlinkPlatformImpl::createOffscreenGraphicsContext3D(
const blink::WebGraphicsContext3D::Attributes& attributes) {
return createOffscreenGraphicsContext3D(attributes, nullptr, nullptr);
}

blink::WebGraphicsContext3DProvider*
BlinkPlatformImpl::createSharedOffscreenGraphicsContext3DProvider() {
return nullptr;
}

blink::WebData BlinkPlatformImpl::loadResource(const char* resource) {
for (size_t i = 0; i < arraysize(kDataResources); ++i) {
if (!strcmp(resource, kDataResources[i].name)) {
Expand Down
12 changes: 0 additions & 12 deletions components/html_viewer/blink_platform_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,6 @@ class BlinkPlatformImpl : public blink::Platform {
virtual blink::WebScrollbarBehavior* scrollbarBehavior();
virtual const unsigned char* getTraceCategoryEnabledFlag(
const char* category_name);
virtual blink::WebGraphicsContext3D* createOffscreenGraphicsContext3D(
const blink::WebGraphicsContext3D::Attributes& attributes,
blink::WebGraphicsContext3D* share_context);
virtual blink::WebGraphicsContext3D* createOffscreenGraphicsContext3D(
const blink::WebGraphicsContext3D::Attributes& attributes,
blink::WebGraphicsContext3D* share_context,
blink::WebGLInfo* gl_info);
virtual blink::WebGraphicsContext3D* createOffscreenGraphicsContext3D(
const blink::WebGraphicsContext3D::Attributes& attributes);
virtual blink::WebGraphicsContext3DProvider*
createSharedOffscreenGraphicsContext3DProvider();
virtual blink::WebData loadResource(const char* name);
virtual blink::WebGestureCurve* createFlingAnimationCurve(
blink::WebGestureDevice device_source,
Expand All @@ -99,7 +88,6 @@ class BlinkPlatformImpl : public blink::Platform {

static void DestroyCurrentThread(void*);

mojo::ApplicationImpl* app_;
scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
scoped_ptr<scheduler::WebThreadImplForRendererScheduler> main_thread_;
base::ThreadLocalStorage::Slot current_thread_slot_;
Expand Down
7 changes: 0 additions & 7 deletions components/html_viewer/html_widget.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include "components/html_viewer/html_widget.h"

#include "base/command_line.h"
#include "components/html_viewer/global_state.h"
#include "components/html_viewer/ime_controller.h"
#include "components/html_viewer/stats_collection_controller.h"
Expand All @@ -21,8 +20,6 @@
namespace html_viewer {
namespace {

const char kDisableWebGLSwitch[] = "disable-webgl";

scoped_ptr<WebLayerTreeViewImpl> CreateWebLayerTreeView(
GlobalState* global_state) {
return make_scoped_ptr(new WebLayerTreeViewImpl(
Expand Down Expand Up @@ -60,10 +57,6 @@ void ConfigureSettings(blink::WebSettings* settings) {
settings->setDefaultFontSize(16);
settings->setLoadsImagesAutomatically(true);
settings->setJavaScriptEnabled(true);

base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
settings->setExperimentalWebGLEnabled(
!command_line->HasSwitch(kDisableWebGLSwitch));
}

} // namespace
Expand Down

This file was deleted.

This file was deleted.

6 changes: 3 additions & 3 deletions components/mus/gles2/command_buffer_driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ bool CommandBufferDriver::DoInitialize(
gpu::gles2::DisallowedFeatures disallowed_features;

// TODO(piman): attributes.
const bool offscreen = true;
std::vector<int32> attrib_vector;
if (!decoder_->Initialize(surface_, context_, offscreen, gfx::Size(1, 1),
disallowed_features, attrib_vector))
if (!decoder_->Initialize(surface_, context_, false /* offscreen */,
gfx::Size(1, 1), disallowed_features,
attrib_vector))
return false;

command_buffer_->SetPutOffsetChangeCallback(base::Bind(
Expand Down
9 changes: 1 addition & 8 deletions gpu/command_buffer/build_gles2_cmd_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2201,7 +2201,6 @@
'BlitFramebufferCHROMIUM': {
'decoder_func': 'DoBlitFramebufferCHROMIUM',
'unit_test': False,
'extension': 'chromium_framebuffer_multisample',
'extension_flag': 'chromium_framebuffer_multisample',
'pepper_interface': 'FramebufferBlit',
'pepper_name': 'BlitFramebufferEXT',
Expand Down Expand Up @@ -3268,7 +3267,6 @@
'gl_test_func': 'glRenderbufferStorageMultisampleCHROMIUM',
'expectation': False,
'unit_test': False,
'extension': 'chromium_framebuffer_multisample',
'extension_flag': 'chromium_framebuffer_multisample',
'pepper_interface': 'FramebufferMultisample',
'pepper_name': 'RenderbufferStorageMultisampleEXT',
Expand Down Expand Up @@ -4876,8 +4874,7 @@ def WriteMojoGLES2Impl(self, func, f):
"CHROMIUM_sub_image", "CHROMIUM_miscellaneous",
"occlusion_query_EXT", "CHROMIUM_image",
"CHROMIUM_copy_texture",
"CHROMIUM_pixel_transfer_buffer_object",
"chromium_framebuffer_multisample"]
"CHROMIUM_pixel_transfer_buffer_object"]
if func.IsCoreGLFunction() or func.GetInfo("extension") in extensions:
f.write("MojoGLES2MakeCurrent(context_);");
func_return = "gl" + func.original_name + "(" + \
Expand Down Expand Up @@ -10459,7 +10456,6 @@ def WriteMojoGLES2Impl(self, filename):
#include "base/logging.h"
#include "third_party/mojo/src/mojo/public/c/gles2/chromium_copy_texture.h"
#include "third_party/mojo/src/mojo/public/c/gles2/chromium_framebuffer_multisample.h"
#include "third_party/mojo/src/mojo/public/c/gles2/chromium_image.h"
#include "third_party/mojo/src/mojo/public/c/gles2/chromium_miscellaneous.h"
#include "third_party/mojo/src/mojo/public/c/gles2/chromium_pixel_transfer_buffer_object.h"
Expand Down Expand Up @@ -11034,9 +11030,6 @@ def main(argv):
gen.WriteMojoGLCallVisitorForExtension(
mojo_gles2_prefix + "_chromium_pixel_transfer_buffer_object_autogen.h",
"CHROMIUM_pixel_transfer_buffer_object")
gen.WriteMojoGLCallVisitorForExtension(
mojo_gles2_prefix + "_chromium_framebuffer_multisample_autogen.h",
"chromium_framebuffer_multisample")

Format(gen.generated_cpp_filenames)

Expand Down
1 change: 0 additions & 1 deletion mojo/gles2/gles2_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ void* MojoGLES2GetContextSupport(MojoGLES2Context context) {
}
#include "mojo/public/c/gles2/gles2_call_visitor_autogen.h"
#include "mojo/public/c/gles2/gles2_call_visitor_chromium_copy_texture_autogen.h"
#include "mojo/public/c/gles2/gles2_call_visitor_chromium_framebuffer_multisample_autogen.h"
#include "mojo/public/c/gles2/gles2_call_visitor_chromium_image_autogen.h"
#include "mojo/public/c/gles2/gles2_call_visitor_chromium_miscellaneous_autogen.h"
#include "mojo/public/c/gles2/gles2_call_visitor_chromium_pixel_transfer_buffer_object_autogen.h"
Expand Down
9 changes: 2 additions & 7 deletions mojo/gpu/mojo_gles2_impl_autogen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

#include "base/logging.h"
#include "third_party/mojo/src/mojo/public/c/gles2/chromium_copy_texture.h"
#include "third_party/mojo/src/mojo/public/c/gles2/chromium_framebuffer_multisample.h"
#include "third_party/mojo/src/mojo/public/c/gles2/chromium_image.h"
#include "third_party/mojo/src/mojo/public/c/gles2/chromium_miscellaneous.h"
#include "third_party/mojo/src/mojo/public/c/gles2/chromium_pixel_transfer_buffer_object.h"
Expand Down Expand Up @@ -1222,19 +1221,15 @@ void MojoGLES2Impl::BlitFramebufferCHROMIUM(GLint srcX0,
GLint dstY1,
GLbitfield mask,
GLenum filter) {
MojoGLES2MakeCurrent(context_);
glBlitFramebufferCHROMIUM(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1,
dstY1, mask, filter);
NOTREACHED() << "Unimplemented BlitFramebufferCHROMIUM.";
}
void MojoGLES2Impl::RenderbufferStorageMultisampleCHROMIUM(
GLenum target,
GLsizei samples,
GLenum internalformat,
GLsizei width,
GLsizei height) {
MojoGLES2MakeCurrent(context_);
glRenderbufferStorageMultisampleCHROMIUM(target, samples, internalformat,
width, height);
NOTREACHED() << "Unimplemented RenderbufferStorageMultisampleCHROMIUM.";
}
void MojoGLES2Impl::RenderbufferStorageMultisampleEXT(GLenum target,
GLsizei samples,
Expand Down
4 changes: 0 additions & 4 deletions mojo/runner/native_application_support.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "base/logging.h"
#include "mojo/platform_handle/platform_handle_private_thunks.h"
#include "mojo/public/platform/native/gles2_impl_chromium_copy_texture_thunks.h"
#include "mojo/public/platform/native/gles2_impl_chromium_framebuffer_multisample_thunks.h"
#include "mojo/public/platform/native/gles2_impl_chromium_image_thunks.h"
#include "mojo/public/platform/native/gles2_impl_chromium_miscellaneous_thunks.h"
#include "mojo/public/platform/native/gles2_impl_chromium_pixel_transfer_buffer_object_thunks.h"
Expand Down Expand Up @@ -85,9 +84,6 @@ bool RunNativeApplication(base::NativeLibrary app_library,
// they are missing.
SetThunks(MojoMakeGLES2ImplChromiumCopyTextureThunks,
"MojoSetGLES2ImplChromiumCopyTextureThunks", app_library);
SetThunks(MojoMakeGLES2ImplChromiumFramebufferMultisampleThunks,
"MojoSetGLES2ImplChromiumFramebufferMultisampleThunks",
app_library);
SetThunks(MojoMakeGLES2ImplChromiumImageThunks,
"MojoSetGLES2ImplChromiumImageThunks", app_library);
SetThunks(MojoMakeGLES2ImplChromiumMiscellaneousThunks,
Expand Down
Loading

0 comments on commit c6374e2

Please sign in to comment.