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

Side by Side Diff: webkit/renderer/compositor_bindings/web_layer_impl.cc

Issue 189883009: Define a --force-gpu-rasterization flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add null check to render_view_impl.cc Created 6 years, 9 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 | « webkit/renderer/compositor_bindings/web_layer_impl.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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 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 "webkit/renderer/compositor_bindings/web_layer_impl.h" 5 #include "webkit/renderer/compositor_bindings/web_layer_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/trace_event_impl.h" 8 #include "base/debug/trace_event_impl.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 23 matching lines...) Expand all
34 using blink::WebFloatPoint; 34 using blink::WebFloatPoint;
35 using blink::WebVector; 35 using blink::WebVector;
36 using blink::WebRect; 36 using blink::WebRect;
37 using blink::WebSize; 37 using blink::WebSize;
38 using blink::WebColor; 38 using blink::WebColor;
39 using blink::WebFilterOperations; 39 using blink::WebFilterOperations;
40 40
41 namespace webkit { 41 namespace webkit {
42 namespace { 42 namespace {
43 43
44 struct ImplSidePaintingStatus { 44 bool g_impl_side_painting_enabled = false;
45 ImplSidePaintingStatus()
46 : enabled(cc::switches::IsImplSidePaintingEnabled()) {
47 }
48 bool enabled;
49 };
50 base::LazyInstance<ImplSidePaintingStatus> g_impl_side_painting_status =
51 LAZY_INSTANCE_INITIALIZER;
52 45
53 } // namespace 46 } // namespace
54 47
55 WebLayerImpl::WebLayerImpl() : layer_(Layer::Create()) { 48 WebLayerImpl::WebLayerImpl() : layer_(Layer::Create()) {
56 web_layer_client_ = NULL; 49 web_layer_client_ = NULL;
57 layer_->SetLayerClient(this); 50 layer_->SetLayerClient(this);
58 } 51 }
59 52
60 WebLayerImpl::WebLayerImpl(scoped_refptr<Layer> layer) : layer_(layer) { 53 WebLayerImpl::WebLayerImpl(scoped_refptr<Layer> layer) : layer_(layer) {
61 web_layer_client_ = NULL; 54 web_layer_client_ = NULL;
62 layer_->SetLayerClient(this); 55 layer_->SetLayerClient(this);
63 } 56 }
64 57
65 WebLayerImpl::~WebLayerImpl() { 58 WebLayerImpl::~WebLayerImpl() {
66 layer_->ClearRenderSurface(); 59 layer_->ClearRenderSurface();
67 layer_->set_layer_animation_delegate(NULL); 60 layer_->set_layer_animation_delegate(NULL);
68 web_layer_client_ = NULL; 61 web_layer_client_ = NULL;
69 } 62 }
70 63
71 // static 64 // static
72 bool WebLayerImpl::UsingPictureLayer() { 65 bool WebLayerImpl::UsingPictureLayer() {
73 return g_impl_side_painting_status.Get().enabled; 66 return g_impl_side_painting_enabled;
67 }
68
69 // static
70 void WebLayerImpl::SetImplSidePaintingEnabled(bool enabled) {
71 g_impl_side_painting_enabled = enabled;
74 } 72 }
75 73
76 int WebLayerImpl::id() const { return layer_->id(); } 74 int WebLayerImpl::id() const { return layer_->id(); }
77 75
78 void WebLayerImpl::invalidateRect(const blink::WebFloatRect& rect) { 76 void WebLayerImpl::invalidateRect(const blink::WebFloatRect& rect) {
79 layer_->SetNeedsDisplayRect(rect); 77 layer_->SetNeedsDisplayRect(rect);
80 } 78 }
81 79
82 void WebLayerImpl::invalidate() { layer_->SetNeedsDisplay(); } 80 void WebLayerImpl::invalidate() { layer_->SetNeedsDisplay(); }
83 81
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 void WebLayerImpl::setClipParent(blink::WebLayer* parent) { 436 void WebLayerImpl::setClipParent(blink::WebLayer* parent) {
439 cc::Layer* clip_parent = NULL; 437 cc::Layer* clip_parent = NULL;
440 if (parent) 438 if (parent)
441 clip_parent = static_cast<WebLayerImpl*>(parent)->layer(); 439 clip_parent = static_cast<WebLayerImpl*>(parent)->layer();
442 layer_->SetClipParent(clip_parent); 440 layer_->SetClipParent(clip_parent);
443 } 441 }
444 442
445 Layer* WebLayerImpl::layer() const { return layer_.get(); } 443 Layer* WebLayerImpl::layer() const { return layer_.get(); }
446 444
447 } // namespace webkit 445 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/renderer/compositor_bindings/web_layer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698