Bug 1318066 - Revert the changes for packing the webrender shaders. r=kats?

Revert "Bug 1318066 - Provide WR with the path to the resources directory. r=jrmuizel?"
This reverts commit 6aeb295d19b80c368cb3a31a096ac76b745797df

Revert "Bug 1318066 - Ensure webrender resources are bundled into the Firefox installation. r=jrmuizel?"
This reverts commit fdfd418626ad2bedc33a6bd813a3472617a9b1e3

MozReview-Commit-ID: FXSAXK5qsmr
This commit is contained in:
JerryShih
2016-11-18 21:56:47 +08:00
parent 2e6f8d233d
commit 3fa7b53999
15 changed files with 17 additions and 107 deletions

View File

@@ -224,6 +224,3 @@ res/table-remove-row.gif
browser/chrome/browser/content/browser/defaultthemes/devedition.icon.png
browser/chrome/browser/content/branding/icon64.png
browser/chrome/devtools/content/framework/dev-edition-promo/dev-edition-logo.png
webrender/ps_clear.glsl
webrender/ps_gradient.glsl
webrender/ps_gradient_clip.glsl

View File

@@ -819,11 +819,6 @@ bin/libfreebl_32int64_3.so
@RESPATH@/components/SanityTest.js
#endif
; webrender
#ifdef MOZ_ENABLE_WEBRENDER
@RESPATH@/webrender/*
#endif
#ifdef MOZ_MULET
#include ../../b2g/installer/package-manifest.in
#endif

View File

@@ -1146,8 +1146,7 @@ CompositorBridgeChild::HandleFatalError(const char* aName, const char* aMsg) con
}
PWebRenderBridgeChild*
CompositorBridgeChild::AllocPWebRenderBridgeChild(const uint64_t& aPipelineId,
const nsString& aResourcePath)
CompositorBridgeChild::AllocPWebRenderBridgeChild(const uint64_t& aPipelineId)
{
WebRenderBridgeChild* child = new WebRenderBridgeChild(aPipelineId);
child->AddRef();

View File

@@ -228,8 +228,7 @@ public:
void WillEndTransaction();
PWebRenderBridgeChild* AllocPWebRenderBridgeChild(const uint64_t& aPipelineId,
const nsString& aResourcePath) override;
PWebRenderBridgeChild* AllocPWebRenderBridgeChild(const uint64_t& aPipelineId) override;
bool DeallocPWebRenderBridgeChild(PWebRenderBridgeChild* aActor) override;
private:

View File

@@ -1842,8 +1842,7 @@ CompositorBridgeParent::RecvAdoptChild(const uint64_t& child)
}
PWebRenderBridgeParent*
CompositorBridgeParent::AllocPWebRenderBridgeParent(const uint64_t& aPipelineId,
const nsString& aResourcePath)
CompositorBridgeParent::AllocPWebRenderBridgeParent(const uint64_t& aPipelineId)
{
#ifndef MOZ_ENABLE_WEBRENDER
// Extra guard since this in the parent process and we don't want a malicious
@@ -1855,7 +1854,7 @@ CompositorBridgeParent::AllocPWebRenderBridgeParent(const uint64_t& aPipelineId,
RefPtr<gl::GLContext> glc(gl::GLContextProvider::CreateForCompositorWidget(mWidget, true));
RefPtr<Compositor> compositor = new WebRenderCompositorOGL(glc.get());
WebRenderBridgeParent* parent = new WebRenderBridgeParent(aPipelineId,
&aResourcePath, mWidget, glc.get(), nullptr, compositor.get());
mWidget, glc.get(), nullptr, compositor.get());
parent->AddRef(); // IPDL reference
MonitorAutoLock lock(*sIndirectLayerTreesLock);
MOZ_ASSERT(sIndirectLayerTrees[aPipelineId].mWRBridge == nullptr);

View File

@@ -539,8 +539,7 @@ public:
return !!mApzcTreeManager;
}
PWebRenderBridgeParent* AllocPWebRenderBridgeParent(const uint64_t& aPipelineId,
const nsString& aResourcePath) override;
PWebRenderBridgeParent* AllocPWebRenderBridgeParent(const uint64_t& aPipelineId) override;
bool DeallocPWebRenderBridgeParent(PWebRenderBridgeParent* aActor) override;
private:

View File

@@ -248,8 +248,7 @@ CrossProcessCompositorBridgeParent::DeallocPAPZParent(PAPZParent* aActor)
}
PWebRenderBridgeParent*
CrossProcessCompositorBridgeParent::AllocPWebRenderBridgeParent(const uint64_t& aPipelineId,
const nsString& aResourcePath)
CrossProcessCompositorBridgeParent::AllocPWebRenderBridgeParent(const uint64_t& aPipelineId)
{
#ifndef MOZ_ENABLE_WEBRENDER
// Extra guard since this in the parent process and we don't want a malicious
@@ -269,7 +268,7 @@ CrossProcessCompositorBridgeParent::AllocPWebRenderBridgeParent(const uint64_t&
WebRenderBridgeParent* root = sIndirectLayerTrees[cbp->RootLayerTreeId()].mWRBridge.get();
WebRenderBridgeParent* parent = new WebRenderBridgeParent(
aPipelineId, nullptr, nullptr, root->GLContext(), root->WindowState(), root->Compositor());
aPipelineId, nullptr, root->GLContext(), root->WindowState(), root->Compositor());
parent->AddRef(); // IPDL reference
sIndirectLayerTrees[aPipelineId].mWRBridge = parent;

View File

@@ -153,8 +153,7 @@ public:
virtual void UpdatePaintTime(LayerTransactionParent* aLayerTree, const TimeDuration& aPaintTime) override;
PWebRenderBridgeParent* AllocPWebRenderBridgeParent(const uint64_t& aPipelineId,
const nsString& aResourcePath) override;
PWebRenderBridgeParent* AllocPWebRenderBridgeParent(const uint64_t& aPipelineId) override;
bool DeallocPWebRenderBridgeParent(PWebRenderBridgeParent* aActor) override;
protected:

View File

@@ -231,7 +231,7 @@ parent:
sync SyncWithCompositor();
// The pipelineId is the same as the layersId
async PWebRenderBridge(uint64_t pipelineId, nsString resourcePath);
async PWebRenderBridge(uint64_t pipelineId);
child:
// Send back Compositor Frame Metrics from APZCs so tiled layers can

View File

@@ -15,7 +15,6 @@ namespace mozilla {
namespace layers {
WebRenderBridgeParent::WebRenderBridgeParent(const uint64_t& aPipelineId,
const nsString* aResourcePath,
widget::CompositorWidget* aWidget,
gl::GLContext* aGlContext,
wrwindowstate* aWrWindowState,
@@ -34,9 +33,7 @@ WebRenderBridgeParent::WebRenderBridgeParent(const uint64_t& aPipelineId,
// i.e. the one created by the CompositorBridgeParent as opposed to the
// CrossProcessCompositorBridgeParent
MOZ_ASSERT(mWidget);
MOZ_ASSERT(aResourcePath);
mWRWindowState = wr_init_window(mPipelineId,
NS_ConvertUTF16toUTF8(*aResourcePath).get());
mWRWindowState = wr_init_window(mPipelineId);
}
}

View File

@@ -31,7 +31,6 @@ class WebRenderBridgeParent final : public PWebRenderBridgeParent
public:
WebRenderBridgeParent(const uint64_t& aPipelineId,
const nsString* aResourcePath,
widget::CompositorWidget* aWidget,
gl::GLContext* aGlContext,
wrwindowstate* aWrWindowState,

View File

@@ -11,8 +11,6 @@
#include "mozilla/layers/AsyncCompositionManager.h"
#include "mozilla/layers/WebRenderBridgeChild.h"
#include "mozilla/widget/PlatformWidgetTypes.h"
#include "nsDirectoryService.h"
#include "nsDirectoryServiceDefs.h"
#include "nsThreadUtils.h"
#include "TreeTraversal.h"
#include "WebRenderCanvasLayer.h"
@@ -145,20 +143,7 @@ WebRenderLayerManager::Initialize(PCompositorBridgeChild* aCBChild, uint64_t aLa
{
MOZ_ASSERT(mWRChild == nullptr);
// Since the WebRenderBridgeParent might be in the compositor process with
// no access to the directory service, we have to get the directory here and
// send it over. We only need to do this for the parent process; the content
// processes ignore it anyway since they don't initialize new WR renderer
// instances.
nsAutoString resourcePath;
if (XRE_IsParentProcess()) {
nsCOMPtr<nsIFile> greDir;
nsDirectoryService::gService->Get(NS_GRE_DIR, NS_GET_IID(nsIFile), getter_AddRefs(greDir));
greDir->Append(NS_LITERAL_STRING("webrender"));
greDir->GetPath(resourcePath);
}
PWebRenderBridgeChild* bridge = aCBChild->SendPWebRenderBridgeConstructor(aLayersId, resourcePath);
PWebRenderBridgeChild* bridge = aCBChild->SendPWebRenderBridgeConstructor(aLayersId);
MOZ_ASSERT(bridge);
mWRChild = static_cast<WebRenderBridgeChild*>(bridge);
LayoutDeviceIntSize size = mWidget->GetClientSize();

View File

@@ -26,62 +26,6 @@ DIRS += [
EXPORTS += ['webrender/webrender.h']
if CONFIG['MOZ_ENABLE_WEBRENDER']:
FINAL_TARGET_FILES.webrender += [
'webrender/res/blur.fs.glsl',
'webrender/res/blur.vs.glsl',
'webrender/res/clip_shared.glsl',
'webrender/res/cs_box_shadow.fs.glsl',
'webrender/res/cs_box_shadow.glsl',
'webrender/res/cs_box_shadow.vs.glsl',
'webrender/res/debug_color.fs.glsl',
'webrender/res/debug_color.vs.glsl',
'webrender/res/debug_font.fs.glsl',
'webrender/res/debug_font.vs.glsl',
'webrender/res/prim_shared.glsl',
'webrender/res/ps_angle_gradient.fs.glsl',
'webrender/res/ps_angle_gradient.glsl',
'webrender/res/ps_angle_gradient.vs.glsl',
'webrender/res/ps_blend.fs.glsl',
'webrender/res/ps_blend.glsl',
'webrender/res/ps_blend.vs.glsl',
'webrender/res/ps_border.fs.glsl',
'webrender/res/ps_border.glsl',
'webrender/res/ps_border.vs.glsl',
'webrender/res/ps_box_shadow.fs.glsl',
'webrender/res/ps_box_shadow.glsl',
'webrender/res/ps_box_shadow.vs.glsl',
'webrender/res/ps_clear.fs.glsl',
'webrender/res/ps_clear.glsl',
'webrender/res/ps_clear.vs.glsl',
'webrender/res/ps_composite.fs.glsl',
'webrender/res/ps_composite.glsl',
'webrender/res/ps_composite.vs.glsl',
'webrender/res/ps_gradient.fs.glsl',
'webrender/res/ps_gradient.glsl',
'webrender/res/ps_gradient.vs.glsl',
'webrender/res/ps_gradient_clip.fs.glsl',
'webrender/res/ps_gradient_clip.glsl',
'webrender/res/ps_gradient_clip.vs.glsl',
'webrender/res/ps_image.fs.glsl',
'webrender/res/ps_image.glsl',
'webrender/res/ps_image.vs.glsl',
'webrender/res/ps_image_clip.fs.glsl',
'webrender/res/ps_image_clip.glsl',
'webrender/res/ps_image_clip.vs.glsl',
'webrender/res/ps_rectangle.fs.glsl',
'webrender/res/ps_rectangle.glsl',
'webrender/res/ps_rectangle.vs.glsl',
'webrender/res/ps_rectangle_clip.fs.glsl',
'webrender/res/ps_rectangle_clip.glsl',
'webrender/res/ps_rectangle_clip.vs.glsl',
'webrender/res/ps_text_run.fs.glsl',
'webrender/res/ps_text_run.glsl',
'webrender/res/ps_text_run.vs.glsl',
'webrender/res/shared.glsl',
'webrender/res/shared_other.glsl',
]
if CONFIG['MOZ_ENABLE_SKIA']:
DIRS += ['skia']

View File

@@ -11,7 +11,7 @@ use webrender_traits::{Epoch, ColorF};
use webrender_traits::{ImageFormat, ImageKey, ImageMask, ImageRendering, RendererKind};
use std::mem;
use std::slice;
use std::os::raw::{c_char, c_uchar};
use std::os::raw::c_uchar;
#[cfg(target_os = "linux")]
mod linux {
@@ -215,10 +215,9 @@ pub struct WrState {
}
#[no_mangle]
pub extern fn wr_init_window(root_pipeline_id: u64, path_utf8: *const c_char) -> *mut WrWindowState {
let res_path = unsafe {
CStr::from_ptr(path_utf8).to_string_lossy().into_owned()
};
pub extern fn wr_init_window(root_pipeline_id: u64) -> *mut WrWindowState {
// hack to find the directory for the shaders
let res_path = concat!(env!("CARGO_MANIFEST_DIR"),"/res");
let library = GlLibrary::new();
gl::load_with(|symbol| library.query(symbol));
@@ -530,4 +529,4 @@ pub extern fn wr_free_buffer(vec_ptr: *mut c_uchar, length: u32, capacity: u32)
unsafe {
let rebuilt = Vec::from_raw_parts(vec_ptr, length as usize, capacity as usize);
}
}
}

View File

@@ -60,7 +60,7 @@ struct wrstate;
#endif
WR_INLINE wrwindowstate*
wr_init_window(uint64_t root_pipeline_id, const char* path_utf8)
wr_init_window(uint64_t root_pipeline_id)
WR_FUNC;
WR_INLINE wrstate*