| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/views/tabs/dragged_tab_view.h" | 5 #include "chrome/browser/ui/views/tabs/dragged_tab_view.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/views/tabs/native_view_photobooth.h" | 7 #include "chrome/browser/ui/views/tabs/native_view_photobooth.h" |
| 8 #include "third_party/skia/include/core/SkShader.h" | 8 #include "third_party/skia/include/core/SkShader.h" |
| 9 #include "ui/gfx/canvas_skia.h" | 9 #include "ui/gfx/canvas_skia.h" |
| 10 #include "views/widget/widget.h" | 10 #include "views/widget/widget.h" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 tab_size_.height() - kDragFrameBorderSize, | 160 tab_size_.height() - kDragFrameBorderSize, |
| 161 ps.width(), ps.height() - tab_size_.height()); | 161 ps.width(), ps.height() - tab_size_.height()); |
| 162 int image_x = kDragFrameBorderSize; | 162 int image_x = kDragFrameBorderSize; |
| 163 int image_y = tab_size_.height(); | 163 int image_y = tab_size_.height(); |
| 164 int image_w = ps.width() - kTwiceDragFrameBorderSize; | 164 int image_w = ps.width() - kTwiceDragFrameBorderSize; |
| 165 int image_h = contents_size_.height(); | 165 int image_h = contents_size_.height(); |
| 166 scale_canvas.FillRectInt(SK_ColorBLACK, image_x, image_y, image_w, image_h); | 166 scale_canvas.FillRectInt(SK_ColorBLACK, image_x, image_y, image_w, image_h); |
| 167 photobooth_->PaintScreenshotIntoCanvas( | 167 photobooth_->PaintScreenshotIntoCanvas( |
| 168 &scale_canvas, | 168 &scale_canvas, |
| 169 gfx::Rect(image_x, image_y, image_w, image_h)); | 169 gfx::Rect(image_x, image_y, image_w, image_h)); |
| 170 renderer_->ProcessPaint(&scale_canvas); | 170 renderer_->Paint(&scale_canvas); |
| 171 | 171 |
| 172 SkIRect subset; | 172 SkIRect subset; |
| 173 subset.set(0, 0, ps.width(), ps.height()); | 173 subset.set(0, 0, ps.width(), ps.height()); |
| 174 SkBitmap mipmap = scale_canvas.ExtractBitmap(); | 174 SkBitmap mipmap = scale_canvas.ExtractBitmap(); |
| 175 mipmap.buildMipMap(true); | 175 mipmap.buildMipMap(true); |
| 176 | 176 |
| 177 SkShader* bitmap_shader = | 177 SkShader* bitmap_shader = |
| 178 SkShader::CreateBitmapShader(mipmap, SkShader::kClamp_TileMode, | 178 SkShader::CreateBitmapShader(mipmap, SkShader::kClamp_TileMode, |
| 179 SkShader::kClamp_TileMode); | 179 SkShader::kClamp_TileMode); |
| 180 | 180 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 #else | 212 #else |
| 213 gfx::Rect bounds; | 213 gfx::Rect bounds; |
| 214 container_->GetBounds(&bounds, true); | 214 container_->GetBounds(&bounds, true); |
| 215 container_->SetBounds(gfx::Rect(bounds.x(), bounds.y(), w, h)); | 215 container_->SetBounds(gfx::Rect(bounds.x(), bounds.y(), w, h)); |
| 216 #endif | 216 #endif |
| 217 } | 217 } |
| 218 | 218 |
| 219 int DraggedTabView::ScaleValue(int value) { | 219 int DraggedTabView::ScaleValue(int value) { |
| 220 return static_cast<int>(value * kScalingFactor); | 220 return static_cast<int>(value * kScalingFactor); |
| 221 } | 221 } |
| OLD | NEW |