Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Side by Side Diff: ui/gfx/compositor/layer.cc

Issue 8764001: Plumb damage rect to browser compositor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gfx/compositor/layer.h" 5 #include "ui/gfx/compositor/layer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 } 322 }
323 323
324 void Layer::SchedulePaint(const gfx::Rect& invalid_rect) { 324 void Layer::SchedulePaint(const gfx::Rect& invalid_rect) {
325 #if defined(USE_WEBKIT_COMPOSITOR) 325 #if defined(USE_WEBKIT_COMPOSITOR)
326 WebKit::WebFloatRect web_rect(invalid_rect.x(), 326 WebKit::WebFloatRect web_rect(invalid_rect.x(),
327 invalid_rect.y(), 327 invalid_rect.y(),
328 invalid_rect.width(), 328 invalid_rect.width(),
329 invalid_rect.height()); 329 invalid_rect.height());
330 if (!web_layer_is_accelerated_) 330 if (!web_layer_is_accelerated_)
331 web_layer_.to<WebKit::WebContentLayer>().invalidateRect(web_rect); 331 web_layer_.to<WebKit::WebContentLayer>().invalidateRect(web_rect);
332 else
333 web_layer_.to<WebKit::WebExternalTextureLayer>().setUpdateRect(web_rect);
332 #else 334 #else
333 invalid_rect_ = invalid_rect_.Union(invalid_rect); 335 invalid_rect_ = invalid_rect_.Union(invalid_rect);
334 ScheduleDraw(); 336 ScheduleDraw();
335 #endif 337 #endif
336 } 338 }
337 339
338 void Layer::ScheduleDraw() { 340 void Layer::ScheduleDraw() {
339 Compositor* compositor = GetCompositor(); 341 Compositor* compositor = GetCompositor();
340 if (compositor) 342 if (compositor)
341 compositor->ScheduleDraw(); 343 compositor->ScheduleDraw();
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 unsigned int color = 0xFF000000; 762 unsigned int color = 0xFF000000;
761 color |= web_layer_is_accelerated_ ? 0x0000FF00 : 0x00FF0000; 763 color |= web_layer_is_accelerated_ ? 0x0000FF00 : 0x00FF0000;
762 bool opaque = fills_bounds_opaquely_ && (GetCombinedOpacity() == 1.f); 764 bool opaque = fills_bounds_opaquely_ && (GetCombinedOpacity() == 1.f);
763 if (!opaque) 765 if (!opaque)
764 color |= 0xFF; 766 color |= 0xFF;
765 web_layer_.setDebugBorderColor(color); 767 web_layer_.setDebugBorderColor(color);
766 } 768 }
767 #endif 769 #endif
768 770
769 } // namespace ui 771 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698