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

Side by Side Diff: cc/content_layer_unittest.cc

Issue 12774006: cc: Chromify Layer and LayerImpl classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: MoreAndroidCompilings Created 7 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 | « cc/content_layer.cc ('k') | cc/contents_scaling_layer.h » ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "cc/content_layer.h" 5 #include "cc/content_layer.h"
6 6
7 #include "cc/bitmap_content_layer_updater.h" 7 #include "cc/bitmap_content_layer_updater.h"
8 #include "cc/content_layer_client.h" 8 #include "cc/content_layer_client.h"
9 #include "cc/test/geometry_test_utils.h" 9 #include "cc/test/geometry_test_utils.h"
10 #include "skia/ext/platform_canvas.h" 10 #include "skia/ext/platform_canvas.h"
(...skipping 21 matching lines...) Expand all
32 gfx::Rect m_opaqueLayerRect; 32 gfx::Rect m_opaqueLayerRect;
33 }; 33 };
34 34
35 TEST(ContentLayerTest, ContentLayerPainterWithDeviceScale) 35 TEST(ContentLayerTest, ContentLayerPainterWithDeviceScale)
36 { 36 {
37 float contentsScale = 2; 37 float contentsScale = 2;
38 gfx::Rect contentRect(10, 10, 100, 100); 38 gfx::Rect contentRect(10, 10, 100, 100);
39 gfx::Rect opaqueRectInLayerSpace(5, 5, 20, 20); 39 gfx::Rect opaqueRectInLayerSpace(5, 5, 20, 20);
40 gfx::RectF opaqueRectInContentSpace = gfx::ScaleRect(opaqueRectInLayerSpace, contentsScale, contentsScale); 40 gfx::RectF opaqueRectInContentSpace = gfx::ScaleRect(opaqueRectInLayerSpace, contentsScale, contentsScale);
41 MockContentLayerClient client(opaqueRectInLayerSpace); 41 MockContentLayerClient client(opaqueRectInLayerSpace);
42 scoped_refptr<BitmapContentLayerUpdater> updater = BitmapContentLayerUpdater ::create(ContentLayerPainter::create(&client).PassAs<LayerPainter>()); 42 scoped_refptr<BitmapContentLayerUpdater> updater = BitmapContentLayerUpdater ::create(ContentLayerPainter::Create(&client).PassAs<LayerPainter>());
43 43
44 gfx::Rect resultingOpaqueRect; 44 gfx::Rect resultingOpaqueRect;
45 updater->prepareToUpdate(contentRect, gfx::Size(256, 256), contentsScale, co ntentsScale, resultingOpaqueRect, NULL); 45 updater->prepareToUpdate(contentRect, gfx::Size(256, 256), contentsScale, co ntentsScale, resultingOpaqueRect, NULL);
46 46
47 EXPECT_RECT_EQ(gfx::ToEnclosingRect(opaqueRectInContentSpace), resultingOpaq ueRect); 47 EXPECT_RECT_EQ(gfx::ToEnclosingRect(opaqueRectInContentSpace), resultingOpaq ueRect);
48 } 48 }
49 49
50 } // namespace 50 } // namespace
51 } // namespace cc 51 } // namespace cc
OLDNEW
« no previous file with comments | « cc/content_layer.cc ('k') | cc/contents_scaling_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698