| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/exo/buffer.h" | 5 #include "components/exo/buffer.h" |
| 6 | 6 |
| 7 #include <GLES2/gl2.h> | 7 #include <GLES2/gl2.h> |
| 8 #include <GLES2/gl2ext.h> | 8 #include <GLES2/gl2ext.h> |
| 9 #include <GLES2/gl2extchromium.h> | 9 #include <GLES2/gl2extchromium.h> |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 return cc::SingleReleaseCallback::Create( | 446 return cc::SingleReleaseCallback::Create( |
| 447 base::Bind(&Buffer::Texture::Release, base::Unretained(texture), | 447 base::Bind(&Buffer::Texture::Release, base::Unretained(texture), |
| 448 base::Bind(&Buffer::ReleaseTexture, AsWeakPtr(), | 448 base::Bind(&Buffer::ReleaseTexture, AsWeakPtr(), |
| 449 base::Passed(&texture_)))); | 449 base::Passed(&texture_)))); |
| 450 } | 450 } |
| 451 | 451 |
| 452 gfx::Size Buffer::GetSize() const { | 452 gfx::Size Buffer::GetSize() const { |
| 453 return gpu_memory_buffer_->GetSize(); | 453 return gpu_memory_buffer_->GetSize(); |
| 454 } | 454 } |
| 455 | 455 |
| 456 scoped_refptr<base::trace_event::TracedValue> Buffer::AsTracedValue() const { | 456 scoped_ptr<base::trace_event::TracedValue> Buffer::AsTracedValue() const { |
| 457 scoped_refptr<base::trace_event::TracedValue> value = | 457 scoped_ptr<base::trace_event::TracedValue> value( |
| 458 new base::trace_event::TracedValue; | 458 new base::trace_event::TracedValue()); |
| 459 gfx::Size size = gpu_memory_buffer_->GetSize(); | 459 gfx::Size size = gpu_memory_buffer_->GetSize(); |
| 460 value->SetInteger("width", size.width()); | 460 value->SetInteger("width", size.width()); |
| 461 value->SetInteger("height", size.height()); | 461 value->SetInteger("height", size.height()); |
| 462 value->SetInteger("format", | 462 value->SetInteger("format", |
| 463 static_cast<int>(gpu_memory_buffer_->GetFormat())); | 463 static_cast<int>(gpu_memory_buffer_->GetFormat())); |
| 464 return value; | 464 return value; |
| 465 } | 465 } |
| 466 | 466 |
| 467 //////////////////////////////////////////////////////////////////////////////// | 467 //////////////////////////////////////////////////////////////////////////////// |
| 468 // Buffer, private: | 468 // Buffer, private: |
| (...skipping 13 matching lines...) Expand all Loading... |
| 482 } | 482 } |
| 483 | 483 |
| 484 void Buffer::ReleaseContentsTexture(scoped_ptr<Texture> texture) { | 484 void Buffer::ReleaseContentsTexture(scoped_ptr<Texture> texture) { |
| 485 TRACE_EVENT0("exo", "Buffer::ReleaseContentsTexture"); | 485 TRACE_EVENT0("exo", "Buffer::ReleaseContentsTexture"); |
| 486 | 486 |
| 487 contents_texture_ = std::move(texture); | 487 contents_texture_ = std::move(texture); |
| 488 Release(); | 488 Release(); |
| 489 } | 489 } |
| 490 | 490 |
| 491 } // namespace exo | 491 } // namespace exo |
| OLD | NEW |