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