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

Side by Side Diff: cc/blink/web_content_layer_impl.cc

Issue 1057283003: Remove parts of //cc we aren't using (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « cc/blink/web_content_layer_impl.h ('k') | cc/blink/web_display_item_list_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "cc/blink/web_content_layer_impl.h"
6
7 #include "cc/blink/web_display_item_list_impl.h"
8 #include "cc/layers/content_layer.h"
9 #include "cc/layers/picture_layer.h"
10 #include "third_party/WebKit/public/platform/WebContentLayerClient.h"
11 #include "third_party/WebKit/public/platform/WebFloatPoint.h"
12 #include "third_party/WebKit/public/platform/WebFloatRect.h"
13 #include "third_party/WebKit/public/platform/WebRect.h"
14 #include "third_party/WebKit/public/platform/WebSize.h"
15 #include "third_party/skia/include/utils/SkMatrix44.h"
16
17 using cc::ContentLayer;
18 using cc::PictureLayer;
19
20 namespace cc_blink {
21
22 static blink::WebContentLayerClient::PaintingControlSetting
23 PaintingControlToWeb(
24 cc::ContentLayerClient::PaintingControlSetting painting_control) {
25 switch (painting_control) {
26 case cc::ContentLayerClient::PAINTING_BEHAVIOR_NORMAL:
27 return blink::WebContentLayerClient::PaintDefaultBehavior;
28 case cc::ContentLayerClient::DISPLAY_LIST_CONSTRUCTION_DISABLED:
29 return blink::WebContentLayerClient::DisplayListConstructionDisabled;
30 case cc::ContentLayerClient::DISPLAY_LIST_CACHING_DISABLED:
31 return blink::WebContentLayerClient::DisplayListCachingDisabled;
32 }
33 NOTREACHED();
34 return blink::WebContentLayerClient::PaintDefaultBehavior;
35 }
36
37 WebContentLayerImpl::WebContentLayerImpl(blink::WebContentLayerClient* client)
38 : client_(client) {
39 if (WebLayerImpl::UsingPictureLayer())
40 layer_ = make_scoped_ptr(new WebLayerImpl(PictureLayer::Create(this)));
41 else
42 layer_ = make_scoped_ptr(new WebLayerImpl(ContentLayer::Create(this)));
43 layer_->layer()->SetIsDrawable(true);
44 }
45
46 WebContentLayerImpl::~WebContentLayerImpl() {
47 if (WebLayerImpl::UsingPictureLayer())
48 static_cast<PictureLayer*>(layer_->layer())->ClearClient();
49 else
50 static_cast<ContentLayer*>(layer_->layer())->ClearClient();
51 }
52
53 blink::WebLayer* WebContentLayerImpl::layer() {
54 return layer_.get();
55 }
56
57 void WebContentLayerImpl::setDoubleSided(bool double_sided) {
58 layer_->layer()->SetDoubleSided(double_sided);
59 }
60
61 void WebContentLayerImpl::setDrawCheckerboardForMissingTiles(bool enable) {
62 layer_->layer()->SetDrawCheckerboardForMissingTiles(enable);
63 }
64
65 void WebContentLayerImpl::PaintContents(
66 SkCanvas* canvas,
67 const gfx::Rect& clip,
68 cc::ContentLayerClient::PaintingControlSetting painting_control) {
69 if (!client_)
70 return;
71
72 client_->paintContents(canvas, clip, PaintingControlToWeb(painting_control));
73 }
74
75 scoped_refptr<cc::DisplayItemList>
76 WebContentLayerImpl::PaintContentsToDisplayList(
77 const gfx::Rect& clip,
78 cc::ContentLayerClient::PaintingControlSetting painting_control) {
79 if (!client_)
80 return cc::DisplayItemList::Create();
81
82 WebDisplayItemListImpl list;
83 client_->paintContents(&list, clip, PaintingControlToWeb(painting_control));
84 return list.ToDisplayItemList();
85 }
86
87 bool WebContentLayerImpl::FillsBoundsCompletely() const {
88 return false;
89 }
90
91 } // namespace cc_blink
OLDNEW
« no previous file with comments | « cc/blink/web_content_layer_impl.h ('k') | cc/blink/web_display_item_list_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698