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

Side by Side Diff: webkit/compositor/WebContentLayerImpl.cpp

Issue 10920056: Make cc_unittests and webkit_compositor_unittests executable always (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rename to webkit_compositor_bindings Created 8 years, 3 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "WebContentLayerImpl.h"
7
8 #include "ContentLayerChromium.h"
9 #include "SkMatrix44.h"
10 #include <public/WebContentLayerClient.h>
11 #include <public/WebFloatPoint.h>
12 #include <public/WebFloatRect.h>
13 #include <public/WebRect.h>
14 #include <public/WebSize.h>
15
16 using namespace WebCore;
17
18 namespace WebKit {
19
20 WebContentLayer* WebContentLayer::create(WebContentLayerClient* client)
21 {
22 return new WebContentLayerImpl(client);
23 }
24
25 WebContentLayerImpl::WebContentLayerImpl(WebContentLayerClient* client)
26 : m_layer(adoptPtr(new WebLayerImpl(ContentLayerChromium::create(this))))
27 , m_client(client)
28 {
29 m_layer->layer()->setIsDrawable(true);
30 }
31
32 WebContentLayerImpl::~WebContentLayerImpl()
33 {
34 static_cast<ContentLayerChromium*>(m_layer->layer())->clearClient();
35 }
36
37 WebLayer* WebContentLayerImpl::layer()
38 {
39 return m_layer.get();
40 }
41
42 void WebContentLayerImpl::setDoubleSided(bool doubleSided)
43 {
44 m_layer->layer()->setDoubleSided(doubleSided);
45 }
46
47 void WebContentLayerImpl::setContentsScale(float scale)
48 {
49 m_layer->layer()->setContentsScale(scale);
50 }
51
52 void WebContentLayerImpl::setUseLCDText(bool enable)
53 {
54 m_layer->layer()->setUseLCDText(enable);
55 }
56
57 void WebContentLayerImpl::setDrawCheckerboardForMissingTiles(bool enable)
58 {
59 m_layer->layer()->setDrawCheckerboardForMissingTiles(enable);
60 }
61
62
63 void WebContentLayerImpl::paintContents(SkCanvas* canvas, const IntRect& clip, F loatRect& opaque)
64 {
65 if (!m_client)
66 return;
67 WebFloatRect webOpaque;
68 m_client->paintContents(canvas, WebRect(clip), webOpaque);
69 opaque = webOpaque;
70 }
71
72 } // namespace WebKit
OLDNEW
« no previous file with comments | « webkit/compositor/WebContentLayerImpl.h ('k') | webkit/compositor/WebExternalTextureLayerImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698