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

Side by Side Diff: ui/gfx/ozone/impl/file_surface_factory.cc

Issue 249413003: ozone: dri: Composite to intermediate surface & copy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: minor cleanup Created 6 years, 8 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 "ui/gfx/ozone/impl/file_surface_factory.h" 5 #include "ui/gfx/ozone/impl/file_surface_factory.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 26 matching lines...) Expand all
37 // SurfaceOzoneCanvas overrides: 37 // SurfaceOzoneCanvas overrides:
38 virtual bool ResizeCanvas(const Size& viewport_size) OVERRIDE { 38 virtual bool ResizeCanvas(const Size& viewport_size) OVERRIDE {
39 surface_ = skia::AdoptRef(SkSurface::NewRaster( 39 surface_ = skia::AdoptRef(SkSurface::NewRaster(
40 SkImageInfo::MakeN32Premul(viewport_size.width(), 40 SkImageInfo::MakeN32Premul(viewport_size.width(),
41 viewport_size.height()))); 41 viewport_size.height())));
42 return true; 42 return true;
43 } 43 }
44 virtual skia::RefPtr<SkCanvas> GetCanvas() OVERRIDE { 44 virtual skia::RefPtr<SkCanvas> GetCanvas() OVERRIDE {
45 return skia::SharePtr(surface_->getCanvas()); 45 return skia::SharePtr(surface_->getCanvas());
46 } 46 }
47 virtual bool PresentCanvas() OVERRIDE { 47 virtual bool PresentCanvas(const gfx::Rect& damage) OVERRIDE {
48 SkBitmap bitmap; 48 SkBitmap bitmap;
49 bitmap.setConfig(surface_->getCanvas()->imageInfo()); 49 bitmap.setConfig(surface_->getCanvas()->imageInfo());
50 50
51 // TODO(dnicoara) Use SkImage instead to potentially avoid a copy. 51 // TODO(dnicoara) Use SkImage instead to potentially avoid a copy.
52 // See crbug.com/361605 for details. 52 // See crbug.com/361605 for details.
53 if (surface_->getCanvas()->readPixels(&bitmap, 0, 0)) { 53 if (surface_->getCanvas()->readPixels(&bitmap, 0, 0)) {
54 base::WorkerPool::PostTask( 54 base::WorkerPool::PostTask(
55 FROM_HERE, base::Bind(&WriteDataToFile, location_, bitmap), true); 55 FROM_HERE, base::Bind(&WriteDataToFile, location_, bitmap), true);
56 } 56 }
57 return true; 57 return true;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 return make_scoped_ptr<SurfaceOzoneCanvas>(new FileSurface(location_)); 94 return make_scoped_ptr<SurfaceOzoneCanvas>(new FileSurface(location_));
95 } 95 }
96 96
97 bool FileSurfaceFactory::LoadEGLGLES2Bindings( 97 bool FileSurfaceFactory::LoadEGLGLES2Bindings(
98 AddGLLibraryCallback add_gl_library, 98 AddGLLibraryCallback add_gl_library,
99 SetGLGetProcAddressProcCallback set_gl_get_proc_address) { 99 SetGLGetProcAddressProcCallback set_gl_get_proc_address) {
100 return false; 100 return false;
101 } 101 }
102 102
103 } // namespace gfx 103 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698