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

Side by Side Diff: cc/test/skia_common.cc

Issue 15995033: cc: Low quality support for low res tiles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase fix Created 7 years, 6 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
« no previous file with comments | « cc/resources/tile_manager.cc ('k') | content/renderer/skia_benchmarking_extension.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/skia_common.h" 5 #include "cc/test/skia_common.h"
6 6
7 #include "cc/resources/picture.h" 7 #include "cc/resources/picture.h"
8 #include "skia/ext/refptr.h" 8 #include "skia/ext/refptr.h"
9 #include "third_party/skia/include/core/SkDevice.h" 9 #include "third_party/skia/include/core/SkDevice.h"
10 #include "ui/gfx/rect.h" 10 #include "ui/gfx/rect.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 gfx::Rect layer_rect, 57 gfx::Rect layer_rect,
58 scoped_refptr<Picture> picture) { 58 scoped_refptr<Picture> picture) {
59 SkBitmap bitmap; 59 SkBitmap bitmap;
60 bitmap.setConfig(SkBitmap::kARGB_8888_Config, 60 bitmap.setConfig(SkBitmap::kARGB_8888_Config,
61 layer_rect.width(), 61 layer_rect.width(),
62 layer_rect.height()); 62 layer_rect.height());
63 bitmap.setPixels(buffer); 63 bitmap.setPixels(buffer);
64 SkDevice device(bitmap); 64 SkDevice device(bitmap);
65 SkCanvas canvas(&device); 65 SkCanvas canvas(&device);
66 canvas.clipRect(gfx::RectToSkRect(layer_rect)); 66 canvas.clipRect(gfx::RectToSkRect(layer_rect));
67 picture->Raster(&canvas, NULL, layer_rect, 1.0f, false); 67 picture->Raster(&canvas, NULL, layer_rect, 1.0f);
68 } 68 }
69 69
70 void CreateBitmap(gfx::Size size, const char* uri, SkBitmap* bitmap) { 70 void CreateBitmap(gfx::Size size, const char* uri, SkBitmap* bitmap) {
71 skia::RefPtr<TestLazyPixelRef> lazy_pixel_ref = 71 skia::RefPtr<TestLazyPixelRef> lazy_pixel_ref =
72 skia::AdoptRef(new TestLazyPixelRef(size.width(), size.height())); 72 skia::AdoptRef(new TestLazyPixelRef(size.width(), size.height()));
73 lazy_pixel_ref->setURI(uri); 73 lazy_pixel_ref->setURI(uri);
74 74
75 bitmap->setConfig(SkBitmap::kARGB_8888_Config, 75 bitmap->setConfig(SkBitmap::kARGB_8888_Config,
76 size.width(), 76 size.width(),
77 size.height()); 77 size.height());
78 bitmap->setPixelRef(lazy_pixel_ref.get()); 78 bitmap->setPixelRef(lazy_pixel_ref.get());
79 } 79 }
80 80
81 81
82 } // namespace cc 82 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/tile_manager.cc ('k') | content/renderer/skia_benchmarking_extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698