summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-25 18:25:27 +0000
committerpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-25 18:25:27 +0000
commit886634d1ba1639835dc7b2132b8f7492aa6de77e (patch)
treeaf5f4981ef329cb919d9e9293e2cd8e186aa4fd1 /ui
parent1edc5cf6ebe81f6680cf3857ed5488b522602b66 (diff)
downloadchromium_src-886634d1ba1639835dc7b2132b8f7492aa6de77e.zip
chromium_src-886634d1ba1639835dc7b2132b8f7492aa6de77e.tar.gz
chromium_src-886634d1ba1639835dc7b2132b8f7492aa6de77e.tar.bz2
compositor: minor fixes
This covers a few things, from failing to properly take into account damage in certain cases (e.g. a layer with a texture but no delegate, or a texture layer that is offset from its parent), or trying to set vsync on an offscreen context. BUG=none TEST=manual Review URL: https://chromiumcodereview.appspot.com/10453016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139082 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/compositor/compositor.cc2
-rw-r--r--ui/compositor/layer.cc6
2 files changed, 4 insertions, 4 deletions
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc
index 564f9d8..29734d1 100644
--- a/ui/compositor/compositor.cc
+++ b/ui/compositor/compositor.cc
@@ -101,7 +101,7 @@ WebKit::WebGraphicsContext3D* DefaultContextFactory::CreateContextCommon(
webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWindow(
attrs, compositor->widget(), share_group_.get());
CommandLine* command_line = CommandLine::ForCurrentProcess();
- if (!command_line->HasSwitch(switches::kDisableUIVsync)) {
+ if (!offscreen && !command_line->HasSwitch(switches::kDisableUIVsync)) {
context->makeContextCurrent();
gfx::GLContext* gl_context = gfx::GLContext::GetCurrent();
gl_context->SetSwapInterval(1);
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc
index 6883270..ca3f385 100644
--- a/ui/compositor/layer.cc
+++ b/ui/compositor/layer.cc
@@ -328,7 +328,7 @@ void Layer::SetColor(SkColor color) {
}
bool Layer::SchedulePaint(const gfx::Rect& invalid_rect) {
- if (type_ == LAYER_SOLID_COLOR || !delegate_)
+ if (type_ == LAYER_SOLID_COLOR || (!delegate_ && !texture_))
return false;
damaged_region_.op(invalid_rect.x(),
@@ -347,7 +347,7 @@ void Layer::ScheduleDraw() {
}
void Layer::SendDamagedRects() {
- if (delegate_ && !damaged_region_.isEmpty()) {
+ if ((delegate_ || texture_) && !damaged_region_.isEmpty()) {
for (SkRegion::Iterator iter(damaged_region_);
!iter.done(); iter.next()) {
const SkIRect& sk_damaged = iter.rect();
@@ -359,7 +359,7 @@ void Layer::SendDamagedRects() {
if (scale_content_ && web_layer_is_accelerated_) {
damaged.Inset(-1, -1);
- damaged = damaged.Intersect(bounds_);
+ damaged = damaged.Intersect(gfx::Rect(bounds_.size()));
}
gfx::Rect damaged_in_pixel = ConvertRectToPixel(this, damaged);