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

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

Issue 63443003: cc: Combine analysis and raster (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove analysis time from rendering stats Created 6 years, 11 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
« no previous file with comments | « cc/test/fake_picture_pile_impl.cc ('k') | skia/ext/analysis_canvas.h » ('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/SkBitmapDevice.h" 9 #include "third_party/skia/include/core/SkBitmapDevice.h"
10 #include "ui/gfx/rect.h" 10 #include "ui/gfx/rect.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 gfx::Rect layer_rect, 62 gfx::Rect layer_rect,
63 scoped_refptr<Picture> picture) { 63 scoped_refptr<Picture> picture) {
64 SkBitmap bitmap; 64 SkBitmap bitmap;
65 bitmap.setConfig(SkBitmap::kARGB_8888_Config, 65 bitmap.setConfig(SkBitmap::kARGB_8888_Config,
66 layer_rect.width(), 66 layer_rect.width(),
67 layer_rect.height()); 67 layer_rect.height());
68 bitmap.setPixels(buffer); 68 bitmap.setPixels(buffer);
69 SkBitmapDevice device(bitmap); 69 SkBitmapDevice device(bitmap);
70 SkCanvas canvas(&device); 70 SkCanvas canvas(&device);
71 canvas.clipRect(gfx::RectToSkRect(layer_rect)); 71 canvas.clipRect(gfx::RectToSkRect(layer_rect));
72 picture->Raster(&canvas, NULL, layer_rect, 1.0f); 72 picture->Raster(&canvas, layer_rect, 1.0f);
73 } 73 }
74 74
75 void CreateBitmap(gfx::Size size, const char* uri, SkBitmap* bitmap) { 75 void CreateBitmap(gfx::Size size, const char* uri, SkBitmap* bitmap) {
76 SkImageInfo info = { 76 SkImageInfo info = {
77 size.width(), 77 size.width(),
78 size.height(), 78 size.height(),
79 kPMColor_SkColorType, 79 kPMColor_SkColorType,
80 kPremul_SkAlphaType 80 kPremul_SkAlphaType
81 }; 81 };
82 82
83 skia::RefPtr<TestLazyPixelRef> lazy_pixel_ref = 83 skia::RefPtr<TestLazyPixelRef> lazy_pixel_ref =
84 skia::AdoptRef(new TestLazyPixelRef(info)); 84 skia::AdoptRef(new TestLazyPixelRef(info));
85 lazy_pixel_ref->setURI(uri); 85 lazy_pixel_ref->setURI(uri);
86 86
87 bitmap->setConfig(info); 87 bitmap->setConfig(info);
88 bitmap->setPixelRef(lazy_pixel_ref.get()); 88 bitmap->setPixelRef(lazy_pixel_ref.get());
89 } 89 }
90 90
91 91
92 } // namespace cc 92 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_picture_pile_impl.cc ('k') | skia/ext/analysis_canvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698