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

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

Issue 10700028: Prepare for WebContentLayerClient API change (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months 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
« no previous file with comments | « ui/compositor/layer.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/compositor/layer.h" 5 #include "ui/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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 RecomputeDrawsContentAndUVRect(); 415 RecomputeDrawsContentAndUVRect();
416 SchedulePaint(gfx::Rect(bounds_.size())); 416 SchedulePaint(gfx::Rect(bounds_.size()));
417 if (delegate_) 417 if (delegate_)
418 delegate_->OnDeviceScaleFactorChanged(device_scale_factor); 418 delegate_->OnDeviceScaleFactorChanged(device_scale_factor);
419 for (size_t i = 0; i < children_.size(); ++i) 419 for (size_t i = 0; i < children_.size(); ++i)
420 children_[i]->OnDeviceScaleFactorChanged(device_scale_factor); 420 children_[i]->OnDeviceScaleFactorChanged(device_scale_factor);
421 } 421 }
422 422
423 void Layer::paintContents(WebKit::WebCanvas* web_canvas, 423 void Layer::paintContents(WebKit::WebCanvas* web_canvas,
424 const WebKit::WebRect& clip, 424 const WebKit::WebRect& clip,
425 #if defined(WEBCONTENTLAYERCLIENT_FLOAT_OPAQUE_RECT)
426 WebKit::WebFloatRect& opaque) {
427 #else
425 WebKit::WebRect& opaque) { 428 WebKit::WebRect& opaque) {
429 #endif
426 TRACE_EVENT0("ui", "Layer::paintContents"); 430 TRACE_EVENT0("ui", "Layer::paintContents");
427 gfx::Canvas canvas(web_canvas, 431 gfx::Canvas canvas(web_canvas,
428 ui::GetScaleFactorFromScale(device_scale_factor_), scale_content_); 432 ui::GetScaleFactorFromScale(device_scale_factor_), scale_content_);
429 433
430 if (delegate_) 434 if (delegate_)
431 delegate_->OnPaintLayer(&canvas); 435 delegate_->OnPaintLayer(&canvas);
432 } 436 }
433 437
434 void Layer::SetForceRenderSurface(bool force) { 438 void Layer::SetForceRenderSurface(bool force) {
435 if (force_render_surface_ == force) 439 if (force_render_surface_ == force)
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 return; 664 return;
661 unsigned int color = 0xFF000000; 665 unsigned int color = 0xFF000000;
662 color |= web_layer_is_accelerated_ ? 0x0000FF00 : 0x00FF0000; 666 color |= web_layer_is_accelerated_ ? 0x0000FF00 : 0x00FF0000;
663 bool opaque = fills_bounds_opaquely_ && (GetCombinedOpacity() == 1.f); 667 bool opaque = fills_bounds_opaquely_ && (GetCombinedOpacity() == 1.f);
664 if (!opaque) 668 if (!opaque)
665 color |= 0xFF; 669 color |= 0xFF;
666 web_layer_.setDebugBorderColor(color); 670 web_layer_.setDebugBorderColor(color);
667 } 671 }
668 672
669 } // namespace ui 673 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/layer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698