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

Side by Side Diff: cc/layers/background_filter_layer.cc

Issue 462983003: [WIP] Implement BackGroundFilter as seperate layer in cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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/layers/background_filter_layer.h ('k') | cc/layers/background_filter_layer_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/layers/background_filter_layer.h"
6 #include "cc/layers/background_filter_layer_impl.h"
7
8 namespace cc {
9
10 scoped_ptr<LayerImpl> BackgroundFilterLayer::CreateLayerImpl(
11 LayerTreeImpl* tree_impl) {
12 return BackgroundFilterLayerImpl::Create(tree_impl, id()).PassAs<LayerImpl>();
13 }
14
15 scoped_refptr<BackgroundFilterLayer> BackgroundFilterLayer::Create() {
16 return make_scoped_refptr(new BackgroundFilterLayer());
17 }
18
19 BackgroundFilterLayer::BackgroundFilterLayer() : Layer() {
20 }
21
22 BackgroundFilterLayer::~BackgroundFilterLayer() {
23 }
24
25 void BackgroundFilterLayer::SetBackgroundFilters(
26 const FilterOperations& filters) {
27 filter_operations_ = filters;
28 SetNeedsCommit();
29 }
30
31 void BackgroundFilterLayer::ApplyFilterAtRect(gfx::Rect src_filter_rect) {
32 if (src_filter_rect_ == src_filter_rect)
33 return;
34
35 src_filter_rect_ = src_filter_rect;
36 SetNeedsCommit();
37 }
38
39 void BackgroundFilterLayer::DrawFilteredBackgroundAtRect(
40 gfx::Rect draw_filter_rect) {
41 if (draw_filter_rect_ == draw_filter_rect)
42 return;
43
44 draw_filter_rect_ = draw_filter_rect;
45 SetNeedsCommit();
46 }
47
48 void BackgroundFilterLayer::PushPropertiesTo(LayerImpl* layer) {
49 Layer::PushPropertiesTo(layer);
50 BackgroundFilterLayerImpl* layer_impl =
51 static_cast<BackgroundFilterLayerImpl*>(layer);
52
53 layer_impl->ApplyFilterAtRect(src_filter_rect_);
54 layer_impl->DrawFilteredBackgroundAtRect(draw_filter_rect_);
55 layer_impl->SetBackgroundFilters(filter_operations_);
56 }
57
58 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/background_filter_layer.h ('k') | cc/layers/background_filter_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698