| OLD | NEW | 
|   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/test/fake_content_layer_client.h" |   5 #include "cc/test/fake_content_layer_client.h" | 
|   6  |   6  | 
|   7 #include "third_party/skia/include/core/SkCanvas.h" |   7 #include "third_party/skia/include/core/SkCanvas.h" | 
|   8 #include "ui/gfx/skia_util.h" |   8 #include "ui/gfx/skia_util.h" | 
|   9  |   9  | 
|  10 namespace cc { |  10 namespace cc { | 
| (...skipping 22 matching lines...) Expand all  Loading... | 
|  33                            draw_rect.right(), |  33                            draw_rect.right(), | 
|  34                            draw_rect.bottom(), |  34                            draw_rect.bottom(), | 
|  35                            paint); |  35                            paint); | 
|  36   } |  36   } | 
|  37  |  37  | 
|  38   for (BitmapVector::const_iterator it = draw_bitmaps_.begin(); |  38   for (BitmapVector::const_iterator it = draw_bitmaps_.begin(); | 
|  39       it != draw_bitmaps_.end(); ++it) { |  39       it != draw_bitmaps_.end(); ++it) { | 
|  40     canvas->drawBitmap(it->bitmap, it->point.x(), it->point.y(), &it->paint); |  40     canvas->drawBitmap(it->bitmap, it->point.x(), it->point.y(), &it->paint); | 
|  41   } |  41   } | 
|  42  |  42  | 
|  43   // Add a rectangle to the middle that doesn't fill |paint_rect| so that solid |  | 
|  44   // color analysis will fail. |  | 
|  45   if (fill_with_nonsolid_color_) { |  43   if (fill_with_nonsolid_color_) { | 
|  46     gfx::RectF draw_rect = paint_rect; |  44     gfx::RectF draw_rect = paint_rect; | 
|  47     draw_rect.Inset(draw_rect.width() / 4.0f, draw_rect.height() / 4.0f); |  45     bool red = true; | 
|  48     SkPaint paint; |  46     while (!draw_rect.IsEmpty()) { | 
|  49     canvas->drawRectCoords(draw_rect.x(), |  47       SkPaint paint; | 
|  50                            draw_rect.y(), |  48       paint.setColor(red ? SK_ColorRED : SK_ColorBLUE); | 
|  51                            draw_rect.right(), |  49       canvas->drawRect(gfx::RectFToSkRect(draw_rect), paint); | 
|  52                            draw_rect.bottom(), |  50       draw_rect.Inset(1, 1); | 
|  53                            paint); |  51     } | 
|  54   } |  52   } | 
|  55 } |  53 } | 
|  56  |  54  | 
|  57 bool FakeContentLayerClient::FillsBoundsCompletely() const { return false; } |  55 bool FakeContentLayerClient::FillsBoundsCompletely() const { return false; } | 
|  58  |  56  | 
|  59 }  // namespace cc |  57 }  // namespace cc | 
| OLD | NEW |