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

Side by Side Diff: content/common/cc_messages_unittest.cc

Issue 16968002: Move implementation of WebFilterOperations into cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | « content/common/cc_messages.cc ('k') | ui/compositor/DEPS » ('j') | 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 "content/common/cc_messages.h" 5 #include "content/common/cc_messages.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "cc/output/compositor_frame.h" 9 #include "cc/output/compositor_frame.h"
10 #include "ipc/ipc_message.h" 10 #include "ipc/ipc_message.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 using cc::CheckerboardDrawQuad; 13 using cc::CheckerboardDrawQuad;
14 using cc::DelegatedFrameData; 14 using cc::DelegatedFrameData;
15 using cc::DebugBorderDrawQuad; 15 using cc::DebugBorderDrawQuad;
16 using cc::DrawQuad; 16 using cc::DrawQuad;
17 using cc::FilterOperation;
18 using cc::FilterOperations;
17 using cc::IOSurfaceDrawQuad; 19 using cc::IOSurfaceDrawQuad;
18 using cc::PictureDrawQuad; 20 using cc::PictureDrawQuad;
19 using cc::RenderPass; 21 using cc::RenderPass;
20 using cc::RenderPassDrawQuad; 22 using cc::RenderPassDrawQuad;
21 using cc::ResourceProvider; 23 using cc::ResourceProvider;
22 using cc::SharedQuadState; 24 using cc::SharedQuadState;
23 using cc::SolidColorDrawQuad; 25 using cc::SolidColorDrawQuad;
24 using cc::TextureDrawQuad; 26 using cc::TextureDrawQuad;
25 using cc::TileDrawQuad; 27 using cc::TileDrawQuad;
26 using cc::TransferableResource; 28 using cc::TransferableResource;
27 using cc::StreamVideoDrawQuad; 29 using cc::StreamVideoDrawQuad;
28 using cc::VideoLayerImpl; 30 using cc::VideoLayerImpl;
29 using cc::YUVVideoDrawQuad; 31 using cc::YUVVideoDrawQuad;
30 using gfx::Transform; 32 using gfx::Transform;
31 using WebKit::WebFilterOperation;
32 using WebKit::WebFilterOperations;
33 33
34 namespace content { 34 namespace content {
35 namespace { 35 namespace {
36 36
37 class CCMessagesTest : public testing::Test { 37 class CCMessagesTest : public testing::Test {
38 protected: 38 protected:
39 void Compare(const RenderPass* a, const RenderPass* b) { 39 void Compare(const RenderPass* a, const RenderPass* b) {
40 EXPECT_EQ(a->id, b->id); 40 EXPECT_EQ(a->id, b->id);
41 EXPECT_EQ(a->output_rect.ToString(), b->output_rect.ToString()); 41 EXPECT_EQ(a->output_rect.ToString(), b->output_rect.ToString());
42 EXPECT_EQ(a->damage_rect.ToString(), b->damage_rect.ToString()); 42 EXPECT_EQ(a->damage_rect.ToString(), b->damage_rect.ToString());
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 int arbitrary_int = 5; 213 int arbitrary_int = 5;
214 SkColor arbitrary_color = SkColorSetARGB(25, 36, 47, 58); 214 SkColor arbitrary_color = SkColorSetARGB(25, 36, 47, 58);
215 IOSurfaceDrawQuad::Orientation arbitrary_orientation = 215 IOSurfaceDrawQuad::Orientation arbitrary_orientation =
216 IOSurfaceDrawQuad::UNFLIPPED; 216 IOSurfaceDrawQuad::UNFLIPPED;
217 RenderPass::Id arbitrary_id(10, 14); 217 RenderPass::Id arbitrary_id(10, 14);
218 ResourceProvider::ResourceId arbitrary_resourceid1 = 55; 218 ResourceProvider::ResourceId arbitrary_resourceid1 = 55;
219 ResourceProvider::ResourceId arbitrary_resourceid2 = 47; 219 ResourceProvider::ResourceId arbitrary_resourceid2 = 47;
220 ResourceProvider::ResourceId arbitrary_resourceid3 = 23; 220 ResourceProvider::ResourceId arbitrary_resourceid3 = 23;
221 ResourceProvider::ResourceId arbitrary_resourceid4 = 16; 221 ResourceProvider::ResourceId arbitrary_resourceid4 = 16;
222 222
223 WebFilterOperations arbitrary_filters1; 223 FilterOperations arbitrary_filters1;
224 arbitrary_filters1.append(WebFilterOperation::createGrayscaleFilter( 224 arbitrary_filters1.Append(FilterOperation::CreateGrayscaleFilter(
225 arbitrary_float1)); 225 arbitrary_float1));
226 226
227 WebFilterOperations arbitrary_filters2; 227 FilterOperations arbitrary_filters2;
228 arbitrary_filters2.append(WebFilterOperation::createBrightnessFilter( 228 arbitrary_filters2.Append(FilterOperation::CreateBrightnessFilter(
229 arbitrary_float2)); 229 arbitrary_float2));
230 230
231 // TODO(danakj): filter is not serialized. 231 // TODO(danakj): filter is not serialized.
232 skia::RefPtr<SkImageFilter> arbitrary_filter; 232 skia::RefPtr<SkImageFilter> arbitrary_filter;
233 233
234 scoped_ptr<SharedQuadState> shared_state1_in = SharedQuadState::Create(); 234 scoped_ptr<SharedQuadState> shared_state1_in = SharedQuadState::Create();
235 shared_state1_in->SetAll(arbitrary_matrix, 235 shared_state1_in->SetAll(arbitrary_matrix,
236 arbitrary_size1, 236 arbitrary_size1,
237 arbitrary_rect1, 237 arbitrary_rect1,
238 arbitrary_rect2, 238 arbitrary_rect2,
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 EXPECT_TRUE(IPC::ParamTraits<DelegatedFrameData>::Read(&msg, 521 EXPECT_TRUE(IPC::ParamTraits<DelegatedFrameData>::Read(&msg,
522 &iter, &frame_out)); 522 &iter, &frame_out));
523 523
524 ASSERT_EQ(2u, frame_out.resource_list.size()); 524 ASSERT_EQ(2u, frame_out.resource_list.size());
525 Compare(arbitrary_resource1, frame_out.resource_list[0]); 525 Compare(arbitrary_resource1, frame_out.resource_list[0]);
526 Compare(arbitrary_resource2, frame_out.resource_list[1]); 526 Compare(arbitrary_resource2, frame_out.resource_list[1]);
527 } 527 }
528 528
529 } // namespace 529 } // namespace
530 } // namespace content 530 } // namespace content
OLDNEW
« no previous file with comments | « content/common/cc_messages.cc ('k') | ui/compositor/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698