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

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

Issue 22796028: Updating Chromium to Skia SkBaseDevice/SkBitmapDevice split (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added TODOs Created 7 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
« no previous file with comments | « cc/test/skia_common.cc ('k') | chrome/browser/extensions/extension_action.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "build/build_config.h" 5 #include "build/build_config.h"
6 #include "cc/layers/content_layer.h" 6 #include "cc/layers/content_layer.h"
7 #include "cc/layers/solid_color_layer.h" 7 #include "cc/layers/solid_color_layer.h"
8 #include "cc/layers/texture_layer.h" 8 #include "cc/layers/texture_layer.h"
9 #include "cc/output/copy_output_request.h" 9 #include "cc/output/copy_output_request.h"
10 #include "cc/output/copy_output_result.h" 10 #include "cc/output/copy_output_result.h"
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 TEST_F(LayerTreeHostReadbackPixelTest, 845 TEST_F(LayerTreeHostReadbackPixelTest,
846 ReadbackNonRootTextureLayerOutsideViewport) { 846 ReadbackNonRootTextureLayerOutsideViewport) {
847 scoped_refptr<SolidColorLayer> background = CreateSolidColorLayer( 847 scoped_refptr<SolidColorLayer> background = CreateSolidColorLayer(
848 gfx::Rect(200, 200), SK_ColorWHITE); 848 gfx::Rect(200, 200), SK_ColorWHITE);
849 849
850 SkBitmap bitmap; 850 SkBitmap bitmap;
851 bitmap.setConfig(SkBitmap::kARGB_8888_Config, 200, 200); 851 bitmap.setConfig(SkBitmap::kARGB_8888_Config, 200, 200);
852 bitmap.allocPixels(); 852 bitmap.allocPixels();
853 bitmap.eraseColor(SK_ColorGREEN); 853 bitmap.eraseColor(SK_ColorGREEN);
854 { 854 {
855 SkDevice device(bitmap); 855 SkBitmapDevice device(bitmap);
856 skia::RefPtr<SkCanvas> canvas = skia::AdoptRef(new SkCanvas(&device)); 856 skia::RefPtr<SkCanvas> canvas = skia::AdoptRef(new SkCanvas(&device));
857 SkPaint paint; 857 SkPaint paint;
858 paint.setStyle(SkPaint::kFill_Style); 858 paint.setStyle(SkPaint::kFill_Style);
859 paint.setColor(SK_ColorBLUE); 859 paint.setColor(SK_ColorBLUE);
860 canvas->drawRect(SkRect::MakeXYWH(150, 150, 50, 50), paint); 860 canvas->drawRect(SkRect::MakeXYWH(150, 150, 50, 50), paint);
861 } 861 }
862 862
863 scoped_refptr<TextureLayer> texture = CreateTextureLayer( 863 scoped_refptr<TextureLayer> texture = CreateTextureLayer(
864 gfx::Rect(200, 200), bitmap); 864 gfx::Rect(200, 200), bitmap);
865 865
(...skipping 11 matching lines...) Expand all
877 background, 877 background,
878 texture.get(), 878 texture.get(),
879 base::FilePath(FILE_PATH_LITERAL( 879 base::FilePath(FILE_PATH_LITERAL(
880 "green_with_blue_corner.png"))); 880 "green_with_blue_corner.png")));
881 } 881 }
882 882
883 } // namespace 883 } // namespace
884 } // namespace cc 884 } // namespace cc
885 885
886 #endif // OS_ANDROID 886 #endif // OS_ANDROID
OLDNEW
« no previous file with comments | « cc/test/skia_common.cc ('k') | chrome/browser/extensions/extension_action.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698