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

Side by Side Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 27973002: cc: Adding ETC1 support to UIResourceBitmap and ResourceProvider (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments, added test, dcheck for compressed texture availability Created 7 years, 2 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
1 // Copyright 2011 The Chromium Authors. All rights reserved. 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 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/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 3299 matching lines...) Expand 10 before | Expand all | Expand 10 after
3310 3310
3311 host_impl_->SetViewportSize(DipSizeToPixelSize(viewport_size_)); 3311 host_impl_->SetViewportSize(DipSizeToPixelSize(viewport_size_));
3312 SetupActiveTreeLayers(); 3312 SetupActiveTreeLayers();
3313 3313
3314 SkBitmap skbitmap; 3314 SkBitmap skbitmap;
3315 skbitmap.setConfig(SkBitmap::kARGB_8888_Config, 2, 2); 3315 skbitmap.setConfig(SkBitmap::kARGB_8888_Config, 2, 2);
3316 skbitmap.allocPixels(); 3316 skbitmap.allocPixels();
3317 skbitmap.setImmutable(); 3317 skbitmap.setImmutable();
3318 3318
3319 // Specify an overhang bitmap to use. 3319 // Specify an overhang bitmap to use.
3320 UIResourceBitmap ui_resource_bitmap(skbitmap, UIResourceBitmap::REPEAT); 3320 UIResourceBitmap ui_resource_bitmap(skbitmap);
3321 ui_resource_bitmap.SetWrapMode(UIResourceBitmap::REPEAT);
3321 UIResourceId ui_resource_id = 12345; 3322 UIResourceId ui_resource_id = 12345;
3322 host_impl_->CreateUIResource(ui_resource_id, ui_resource_bitmap); 3323 host_impl_->CreateUIResource(ui_resource_id, ui_resource_bitmap);
3323 host_impl_->SetOverhangUIResource(ui_resource_id, gfx::Size(32, 32)); 3324 host_impl_->SetOverhangUIResource(ui_resource_id, gfx::Size(32, 32));
3324 set_gutter_quad_material(DrawQuad::TEXTURE_CONTENT); 3325 set_gutter_quad_material(DrawQuad::TEXTURE_CONTENT);
3325 set_gutter_texture_size(gfx::Size(32, 32)); 3326 set_gutter_texture_size(gfx::Size(32, 32));
3326 3327
3327 TestLayerCoversFullViewport(); 3328 TestLayerCoversFullViewport();
3328 TestEmptyLayer(); 3329 TestEmptyLayer();
3329 TestLayerInMiddleOfViewport(); 3330 TestLayerInMiddleOfViewport();
3330 TestLayerIsLargerThanViewport(); 3331 TestLayerIsLargerThanViewport();
(...skipping 2153 matching lines...) Expand 10 before | Expand all | Expand 10 after
5484 // The root should have scrolled. 5485 // The root should have scrolled.
5485 ASSERT_EQ(2u, scroll_info->scrolls.size()); 5486 ASSERT_EQ(2u, scroll_info->scrolls.size());
5486 ExpectContains(*scroll_info.get(), 5487 ExpectContains(*scroll_info.get(),
5487 host_impl_->active_tree()->root_layer()->id(), 5488 host_impl_->active_tree()->root_layer()->id(),
5488 gfx::Vector2d(0, 10)); 5489 gfx::Vector2d(0, 10));
5489 } 5490 }
5490 } 5491 }
5491 5492
5492 } // namespace 5493 } // namespace
5493 } // namespace cc 5494 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698