summaryrefslogtreecommitdiffstats
path: root/ui/compositor
diff options
context:
space:
mode:
authorpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-10 23:44:28 +0000
committerpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-10 23:44:28 +0000
commit3440845075f4883e916cd99954a9fd947ec09ade (patch)
tree89cfa73e661bdbc0daebece9fa24ef98e26c4f86 /ui/compositor
parent16c78758426af699b157a64097219c304453cb7d (diff)
downloadchromium_src-3440845075f4883e916cd99954a9fd947ec09ade.zip
chromium_src-3440845075f4883e916cd99954a9fd947ec09ade.tar.gz
chromium_src-3440845075f4883e916cd99954a9fd947ec09ade.tar.bz2
Partial revert of 146621
The original patch introduced a crash (GetCompositor() can return NULL), but reverting the whole thing is not possible without a lot of other reverts, and the proper fix is fairly involve (likely not reasonable to patch to the branch). This only reverts the problematic part, and a follow up will do a proper fix. BUG=141756 Review URL: https://chromiumcodereview.appspot.com/10828262 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151153 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/compositor')
-rw-r--r--ui/compositor/compositor.h1
-rw-r--r--ui/compositor/layer.cc18
-rw-r--r--ui/compositor/layer.h9
3 files changed, 4 insertions, 24 deletions
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
index ea57724..49b970a 100644
--- a/ui/compositor/compositor.h
+++ b/ui/compositor/compositor.h
@@ -101,7 +101,6 @@ class COMPOSITOR_EXPORT Texture : public base::RefCounted<Texture> {
void set_texture_id(unsigned int id) { texture_id_ = id; }
bool flipped() const { return flipped_; }
gfx::Size size() const { return size_; }
- virtual WebKit::WebGraphicsContext3D* HostContext3D() = 0;
protected:
virtual ~Texture();
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc
index 7b752f7..d6b2257 100644
--- a/ui/compositor/layer.cc
+++ b/ui/compositor/layer.cc
@@ -371,14 +371,10 @@ void Layer::SetExternalTexture(Texture* texture) {
WebKit::WebLayer new_layer;
if (layer_updated_externally_) {
WebKit::WebExternalTextureLayer texture_layer =
- WebKit::WebExternalTextureLayer::create(this);
+ WebKit::WebExternalTextureLayer::create();
texture_layer.setFlipped(texture_->flipped());
new_layer = texture_layer;
} else {
- // Tell the compositor to clear references to the old texture.
- WebKit::WebExternalTextureLayer texture_layer =
- web_layer_.to<WebKit::WebExternalTextureLayer>();
- texture_layer.willModifyTexture();
new_layer = WebKit::WebContentLayer::create(this);
}
if (parent_) {
@@ -507,16 +503,6 @@ void Layer::paintContents(WebKit::WebCanvas* web_canvas,
canvas->Restore();
}
-unsigned Layer::prepareTexture(WebKit::WebTextureUpdater& /* updater */) {
- DCHECK(layer_updated_externally_);
- return texture_->texture_id();
-}
-
-WebKit::WebGraphicsContext3D* Layer::context() {
- DCHECK(layer_updated_externally_);
- return texture_->HostContext3D();
-}
-
void Layer::SetForceRenderSurface(bool force) {
if (force_render_surface_ == force)
return;
@@ -741,8 +727,10 @@ void Layer::RecomputeDrawsContentAndUVRect() {
web_layer_.setBounds(ConvertSizeToPixel(this, bounds_.size()));
} else {
DCHECK(texture_);
+ unsigned int texture_id = texture_->texture_id();
WebKit::WebExternalTextureLayer texture_layer =
web_layer_.to<WebKit::WebExternalTextureLayer>();
+ texture_layer.setTextureId(should_draw ? texture_id : 0);
gfx::Size texture_size;
if (scale_content_)
diff --git a/ui/compositor/layer.h b/ui/compositor/layer.h
index bc16ee1..4eb39cf 100644
--- a/ui/compositor/layer.h
+++ b/ui/compositor/layer.h
@@ -13,7 +13,6 @@
#include "base/memory/scoped_ptr.h"
#include "base/message_loop.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebContentLayerClient.h"
-#include "third_party/WebKit/Source/Platform/chromium/public/WebExternalTextureLayerClient.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebLayer.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkRegion.h"
@@ -44,8 +43,7 @@ class Texture;
// NULL, but the children are not deleted.
class COMPOSITOR_EXPORT Layer
: public LayerAnimationDelegate,
- NON_EXPORTED_BASE(public WebKit::WebContentLayerClient),
- NON_EXPORTED_BASE(public WebKit::WebExternalTextureLayerClient) {
+ NON_EXPORTED_BASE(public WebKit::WebContentLayerClient) {
public:
Layer();
explicit Layer(LayerType type);
@@ -262,11 +260,6 @@ class COMPOSITOR_EXPORT Layer
WebKit::WebLayer web_layer() { return web_layer_; }
- // WebExternalTextureLayerClient
- virtual unsigned prepareTexture(
- WebKit::WebTextureUpdater& /* updater */) OVERRIDE;
- virtual WebKit::WebGraphicsContext3D* context() OVERRIDE;
-
float device_scale_factor() const { return device_scale_factor_; }
// Forces a render surface to be used on this layer. This has no positive