| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/views/tabs/tab_overview_container.h" | 5 #include "chrome/browser/views/tabs/tab_overview_container.h" |
| 6 | 6 |
| 7 #include "app/gfx/canvas.h" | 7 #include "app/gfx/canvas.h" |
| 8 #include "chrome/browser/views/tabs/tab_overview_grid.h" | 8 #include "chrome/browser/views/tabs/tab_overview_grid.h" |
| 9 #include "third_party/skia/include/core/SkPath.h" | 9 #include "third_party/skia/include/core/SkPath.h" |
| 10 #include "third_party/skia/include/effects/SkGradientShader.h" | 10 #include "third_party/skia/include/effects/SkGradientShader.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 SkPoint points[] = { { SkIntToScalar(0), SkIntToScalar(0) }, | 83 SkPoint points[] = { { SkIntToScalar(0), SkIntToScalar(0) }, |
| 84 { SkIntToScalar(0), SkIntToScalar(height()) } }; | 84 { SkIntToScalar(0), SkIntToScalar(height()) } }; |
| 85 SkColor colors[] = { SkColorSetARGB(242, 255, 255, 255), | 85 SkColor colors[] = { SkColorSetARGB(242, 255, 255, 255), |
| 86 SkColorSetARGB(212, 255, 255, 255), }; | 86 SkColorSetARGB(212, 255, 255, 255), }; |
| 87 SkShader* shader = SkGradientShader::CreateLinear( | 87 SkShader* shader = SkGradientShader::CreateLinear( |
| 88 points, colors, NULL, 2, SkShader::kRepeat_TileMode); | 88 points, colors, NULL, 2, SkShader::kRepeat_TileMode); |
| 89 SkPaint paint; | 89 SkPaint paint; |
| 90 paint.setShader(shader); | 90 paint.setShader(shader); |
| 91 shader = NULL; | 91 shader = NULL; |
| 92 paint.setStyle(SkPaint::kFill_Style); | 92 paint.setStyle(SkPaint::kFill_Style); |
| 93 paint.setPorterDuffXfermode(SkPorterDuff::kSrcOver_Mode); | 93 paint.setXfermodeMode(SkXfermode::kSrcOver_Mode); |
| 94 canvas->drawPaint(paint); | 94 canvas->drawPaint(paint); |
| 95 | 95 |
| 96 // Restore the canvas (resetting the clip). | 96 // Restore the canvas (resetting the clip). |
| 97 canvas->restore(); | 97 canvas->restore(); |
| 98 | 98 |
| 99 SkPaint paint2; | 99 SkPaint paint2; |
| 100 paint2.setStyle(SkPaint::kStroke_Style); | 100 paint2.setStyle(SkPaint::kStroke_Style); |
| 101 paint2.setAntiAlias(true); | 101 paint2.setAntiAlias(true); |
| 102 paint2.setColor(SK_ColorWHITE); | 102 paint2.setColor(SK_ColorWHITE); |
| 103 paint2.setStrokeWidth(SkIntToScalar(0)); | 103 paint2.setStrokeWidth(SkIntToScalar(0)); |
| 104 | 104 |
| 105 // And stroke the rounded rect with arrow pointing down. | 105 // And stroke the rounded rect with arrow pointing down. |
| 106 canvas->drawPath(outline, paint2); | 106 canvas->drawPath(outline, paint2); |
| 107 } | 107 } |
| 108 | 108 |
| 109 TabOverviewGrid* TabOverviewContainer::GetTabOverviewGrid() { | 109 TabOverviewGrid* TabOverviewContainer::GetTabOverviewGrid() { |
| 110 return static_cast<TabOverviewGrid*>(GetChildViewAt(0)); | 110 return static_cast<TabOverviewGrid*>(GetChildViewAt(0)); |
| 111 } | 111 } |
| OLD | NEW |