diff options
author | shawnsingh@chromium.org <shawnsingh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-29 11:48:49 +0000 |
---|---|---|
committer | shawnsingh@chromium.org <shawnsingh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-29 11:48:49 +0000 |
commit | 2a9d2c1d0978bb0452c90d3261dcd73461556469 (patch) | |
tree | a8d9c18028fa21801b117072635d17039c3a4ce5 /webkit | |
parent | b56e4322d94e23ca644557c09b5a5829635e5127 (diff) | |
download | chromium_src-2a9d2c1d0978bb0452c90d3261dcd73461556469.zip chromium_src-2a9d2c1d0978bb0452c90d3261dcd73461556469.tar.gz chromium_src-2a9d2c1d0978bb0452c90d3261dcd73461556469.tar.bz2 |
Add CompositingReasons to compositor layers.
This is a re-land after first version (r202580) was reverted. The problem was
that extra invalidations occurred due to a call to SetNeedsCommit(). The
solution is to avoid calling SetNeedsCommit(), and accept that this debug info
will be stale on the impl-thread until something else commits.
BUG=240946
Review URL: https://chromiumcodereview.appspot.com/16023024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202848 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
4 files changed, 153 insertions, 0 deletions
diff --git a/webkit/renderer/compositor_bindings/compositor_bindings.gyp b/webkit/renderer/compositor_bindings/compositor_bindings.gyp index a226887..33f93c6 100644 --- a/webkit/renderer/compositor_bindings/compositor_bindings.gyp +++ b/webkit/renderer/compositor_bindings/compositor_bindings.gyp @@ -12,6 +12,7 @@ 'web_animation_curve_common.h', 'web_animation_impl.cc', 'web_animation_impl.h', + 'web_compositing_reasons.cc', 'web_content_layer_impl.cc', 'web_content_layer_impl.h', 'web_external_texture_layer_impl.cc', diff --git a/webkit/renderer/compositor_bindings/web_compositing_reasons.cc b/webkit/renderer/compositor_bindings/web_compositing_reasons.cc new file mode 100644 index 0000000..0e04a24 --- /dev/null +++ b/webkit/renderer/compositor_bindings/web_compositing_reasons.cc @@ -0,0 +1,144 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/basictypes.h" +#include "cc/layers/compositing_reasons.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebCompositingReasons.h" + +#define COMPILE_ASSERT_MATCHING_ENUMS(cc_name, webkit_name) \ + COMPILE_ASSERT( \ + static_cast<int>(cc_name) == static_cast<int>(webkit_name), \ + mismatching_enums) + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReasonUnknown, + WebKit::CompositingReasonUnknown); + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReason3DTransform, + WebKit::CompositingReason3DTransform); + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReasonVideo, + WebKit::CompositingReasonVideo); + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReasonCanvas, + WebKit::CompositingReasonCanvas); + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReasonPlugin, + WebKit::CompositingReasonPlugin); + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReasonIFrame, + WebKit::CompositingReasonIFrame); + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReasonBackfaceVisibilityHidden, + WebKit::CompositingReasonBackfaceVisibilityHidden); + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReasonAnimation, + WebKit::CompositingReasonAnimation); + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReasonFilters, + WebKit::CompositingReasonFilters); + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReasonPositionFixed, + WebKit::CompositingReasonPositionFixed); + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReasonPositionSticky, + WebKit::CompositingReasonPositionSticky); + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReasonOverflowScrollingTouch, + WebKit::CompositingReasonOverflowScrollingTouch); + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReasonBlending, + WebKit::CompositingReasonBlending); + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReasonAssumedOverlap, + WebKit::CompositingReasonAssumedOverlap); + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReasonOverlap, + WebKit::CompositingReasonOverlap); + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReasonNegativeZIndexChildren, + WebKit::CompositingReasonNegativeZIndexChildren); + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReasonTransformWithCompositedDescendants, + WebKit::CompositingReasonTransformWithCompositedDescendants); + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReasonOpacityWithCompositedDescendants, + WebKit::CompositingReasonOpacityWithCompositedDescendants); + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReasonMaskWithCompositedDescendants, + WebKit::CompositingReasonMaskWithCompositedDescendants); + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReasonReflectionWithCompositedDescendants, + WebKit::CompositingReasonReflectionWithCompositedDescendants); + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReasonFilterWithCompositedDescendants, + WebKit::CompositingReasonFilterWithCompositedDescendants); + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReasonBlendingWithCompositedDescendants, + WebKit::CompositingReasonBlendingWithCompositedDescendants); + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReasonClipsCompositingDescendants, + WebKit::CompositingReasonClipsCompositingDescendants); + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReasonPerspective, + WebKit::CompositingReasonPerspective); + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReasonPreserve3D, + WebKit::CompositingReasonPreserve3D); + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReasonReflectionOfCompositedParent, + WebKit::CompositingReasonReflectionOfCompositedParent); + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReasonRoot, + WebKit::CompositingReasonRoot); + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReasonLayerForClip, + WebKit::CompositingReasonLayerForClip); + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReasonLayerForScrollbar, + WebKit::CompositingReasonLayerForScrollbar); + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReasonLayerForScrollingContainer, + WebKit::CompositingReasonLayerForScrollingContainer); + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReasonLayerForForeground, + WebKit::CompositingReasonLayerForForeground); + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReasonLayerForBackground, + WebKit::CompositingReasonLayerForBackground); + +COMPILE_ASSERT_MATCHING_ENUMS( + cc::kCompositingReasonLayerForMask, + WebKit::CompositingReasonLayerForMask); diff --git a/webkit/renderer/compositor_bindings/web_layer_impl.cc b/webkit/renderer/compositor_bindings/web_layer_impl.cc index f36957c..6645538 100644 --- a/webkit/renderer/compositor_bindings/web_layer_impl.cc +++ b/webkit/renderer/compositor_bindings/web_layer_impl.cc @@ -9,6 +9,7 @@ #include "cc/base/region.h" #include "cc/layers/layer.h" #include "cc/layers/layer_position_constraint.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebCompositingReasons.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatPoint.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatRect.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerPositionConstraint.h" @@ -169,6 +170,11 @@ void WebLayerImpl::setDebugName(WebKit::WebString name) { layer_->SetDebugName(UTF16ToASCII(name)); } +void WebLayerImpl::setCompositingReasons( + WebKit::WebCompositingReasons reasons) { + layer_->SetCompositingReasons(reasons); +} + void WebLayerImpl::setAnimationDelegate( WebKit::WebAnimationDelegate* delegate) { layer_->set_layer_animation_delegate(delegate); diff --git a/webkit/renderer/compositor_bindings/web_layer_impl.h b/webkit/renderer/compositor_bindings/web_layer_impl.h index e218bec..01e7e58 100644 --- a/webkit/renderer/compositor_bindings/web_layer_impl.h +++ b/webkit/renderer/compositor_bindings/web_layer_impl.h @@ -8,6 +8,7 @@ #include "base/memory/ref_counted.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebAnimation.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebColor.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebCompositingReasons.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatPoint.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebLayer.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebPoint.h" @@ -81,6 +82,7 @@ class WebLayerImpl : public WebKit::WebLayer { virtual void setFilters(const WebKit::WebFilterOperations& filters); virtual void setBackgroundFilters(const WebKit::WebFilterOperations& filters); virtual void setDebugName(WebKit::WebString name); + virtual void setCompositingReasons(WebKit::WebCompositingReasons); virtual void setAnimationDelegate(WebKit::WebAnimationDelegate* delegate); virtual bool addAnimation(WebKit::WebAnimation* animation); virtual void removeAnimation(int animation_id); |