Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Side by Side Diff: content/browser/aura/software_output_device_win.cc

Issue 24175004: Remove dependency on ui::ScaleFactor from ui/gfx (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix new usage of scale in FastShowPickler Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "content/browser/aura/software_output_device_win.h" 5 #include "content/browser/aura/software_output_device_win.h"
6 6
7 #include "content/public/browser/browser_thread.h" 7 #include "content/public/browser/browser_thread.h"
8 #include "third_party/skia/include/core/SkBitmap.h" 8 #include "third_party/skia/include/core/SkBitmap.h"
9 #include "third_party/skia/include/core/SkDevice.h" 9 #include "third_party/skia/include/core/SkDevice.h"
10 #include "ui/compositor/compositor.h" 10 #include "ui/compositor/compositor.h"
(...skipping 18 matching lines...) Expand all
29 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 29 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
30 } 30 }
31 31
32 void SoftwareOutputDeviceWin::Resize(gfx::Size viewport_size) { 32 void SoftwareOutputDeviceWin::Resize(gfx::Size viewport_size) {
33 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 33 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
34 34
35 if (viewport_size_ == viewport_size) 35 if (viewport_size_ == viewport_size)
36 return; 36 return;
37 37
38 viewport_size_ = viewport_size; 38 viewport_size_ = viewport_size;
39 contents_.reset(new gfx::Canvas(viewport_size, ui::SCALE_FACTOR_100P, true)); 39 contents_.reset(new gfx::Canvas(viewport_size, 1.0f, true));
40 memset(&bitmap_info_, 0, sizeof(bitmap_info_)); 40 memset(&bitmap_info_, 0, sizeof(bitmap_info_));
41 gfx::CreateBitmapHeader(viewport_size_.width(), viewport_size_.height(), 41 gfx::CreateBitmapHeader(viewport_size_.width(), viewport_size_.height(),
42 &bitmap_info_.bmiHeader); 42 &bitmap_info_.bmiHeader);
43 } 43 }
44 44
45 SkCanvas* SoftwareOutputDeviceWin::BeginPaint(gfx::Rect damage_rect) { 45 SkCanvas* SoftwareOutputDeviceWin::BeginPaint(gfx::Rect damage_rect) {
46 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 46 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
47 DCHECK(contents_); 47 DCHECK(contents_);
48 48
49 damage_rect_ = damage_rect; 49 damage_rect_ = damage_rect;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 void SoftwareOutputDeviceWin::CopyToBitmap( 95 void SoftwareOutputDeviceWin::CopyToBitmap(
96 gfx::Rect rect, SkBitmap* output) { 96 gfx::Rect rect, SkBitmap* output) {
97 DCHECK(contents_); 97 DCHECK(contents_);
98 SkBaseDevice* device = contents_->sk_canvas()->getDevice(); 98 SkBaseDevice* device = contents_->sk_canvas()->getDevice();
99 const SkBitmap& bitmap = device->accessBitmap(false); 99 const SkBitmap& bitmap = device->accessBitmap(false);
100 bitmap.extractSubset(output, gfx::RectToSkIRect(rect)); 100 bitmap.extractSubset(output, gfx::RectToSkIRect(rect));
101 } 101 }
102 102
103 } // namespace content 103 } // namespace content
OLDNEW
« no previous file with comments | « chrome/renderer/pepper/pepper_pdf_host.cc ('k') | content/browser/renderer_host/backing_store_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698