| 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 "cc/layers/append_quads_data.h" | 5 #include "cc/layers/append_quads_data.h" |
| 6 #include "cc/layers/content_layer_client.h" | 6 #include "cc/layers/content_layer_client.h" |
| 7 #include "cc/layers/picture_layer.h" | 7 #include "cc/layers/picture_layer.h" |
| 8 #include "cc/layers/picture_layer_impl.h" | 8 #include "cc/layers/picture_layer_impl.h" |
| 9 #include "cc/quads/draw_quad.h" | 9 #include "cc/quads/draw_quad.h" |
| 10 #include "cc/test/layer_tree_pixel_test.h" | 10 #include "cc/test/layer_tree_pixel_test.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 // Triggers pixel readback and ends the test. | 53 // Triggers pixel readback and ends the test. |
| 54 LayerTreePixelTest::SwapBuffersOnThread(host_impl, result); | 54 LayerTreePixelTest::SwapBuffersOnThread(host_impl, result); |
| 55 } | 55 } |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 class BlueYellowLayerClient : public ContentLayerClient { | 58 class BlueYellowLayerClient : public ContentLayerClient { |
| 59 public: | 59 public: |
| 60 explicit BlueYellowLayerClient(gfx::Rect layer_rect) | 60 explicit BlueYellowLayerClient(gfx::Rect layer_rect) |
| 61 : layer_rect_(layer_rect) {} | 61 : layer_rect_(layer_rect) {} |
| 62 | 62 |
| 63 virtual void DidChangeLayerCanUseLCDText() OVERRIDE { } | 63 virtual bool PaintsLCDText() const OVERRIDE { return false; } |
| 64 | 64 |
| 65 virtual bool FillsBoundsCompletely() const OVERRIDE { return false; } | 65 virtual bool FillsBoundsCompletely() const OVERRIDE { return false; } |
| 66 | 66 |
| 67 virtual void PaintContents( | 67 virtual void PaintContents( |
| 68 SkCanvas* canvas, | 68 SkCanvas* canvas, |
| 69 const gfx::Rect& clip, | 69 const gfx::Rect& clip, |
| 70 bool can_paint_lcd_text, |
| 70 gfx::RectF* opaque, | 71 gfx::RectF* opaque, |
| 71 ContentLayerClient::GraphicsContextStatus gc_status) OVERRIDE { | 72 ContentLayerClient::GraphicsContextStatus gc_status) OVERRIDE { |
| 72 *opaque = gfx::RectF(layer_rect_.width(), layer_rect_.height()); | 73 *opaque = gfx::RectF(layer_rect_.width(), layer_rect_.height()); |
| 73 | 74 |
| 74 SkPaint paint; | 75 SkPaint paint; |
| 75 paint.setColor(SK_ColorBLUE); | 76 paint.setColor(SK_ColorBLUE); |
| 76 canvas->drawRect(SkRect::MakeWH(layer_rect_.width(), | 77 canvas->drawRect(SkRect::MakeWH(layer_rect_.width(), |
| 77 layer_rect_.height() / 2), | 78 layer_rect_.height() / 2), |
| 78 paint); | 79 paint); |
| 79 | 80 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 103 | 104 |
| 104 RunPixelTest(GL_WITH_BITMAP, | 105 RunPixelTest(GL_WITH_BITMAP, |
| 105 layer, | 106 layer, |
| 106 base::FilePath(FILE_PATH_LITERAL("blue_yellow.png"))); | 107 base::FilePath(FILE_PATH_LITERAL("blue_yellow.png"))); |
| 107 } | 108 } |
| 108 | 109 |
| 109 } // namespace | 110 } // namespace |
| 110 } // namespace cc | 111 } // namespace cc |
| 111 | 112 |
| 112 #endif // OS_ANDROID | 113 #endif // OS_ANDROID |
| OLD | NEW |