| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |